import os
from pathlib import Path
testfolder = str(Path().resolve().parent.parent / 'PV_ICE' / 'TEMP' / 'ElectricFutures')
# Another option using relative address; for some operative systems you might need '/' instead of '\'
# testfolder = os.path.abspath(r'..\..\PV_DEMICE\TEMP')
print ("Your simulation will be stored in %s" % testfolder)
Your simulation will be stored in C:\Users\sayala\Documents\GitHub\CircularEconomy-MassFlowCalculator\PV_ICE\TEMP\ElectricFutures
MATERIALS = ['glass','silver','silicon', 'copper','aluminium_frames']
MATERIAL = MATERIALS[0]
MODULEBASELINE = r'..\..\baselines\ElectrificationFutures_2021\baseline_modules_US_NREL_Electrification_Futures_2021_basecase.csv'
MODULEBASELINE_High = r'..\..\baselines\ElectrificationFutures_2021\baseline_modules_US_NREL_Electrification_Futures_2021_LowREHighElec.csv'
import PV_ICE
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
PV_ICE.__version__
'0+untagged.416.g1b87254.dirty'
plt.rcParams.update({'font.size': 22})
plt.rcParams['figure.figsize'] = (12, 5)
r1 = PV_ICE.Simulation(name='PV_ICE', path=testfolder)
r1.createScenario(name='base', file=MODULEBASELINE)
for mat in range (0, len(MATERIALS)):
MATERIALBASELINE = r'..\..\baselines\baseline_material_'+MATERIALS[mat]+'.csv'
r1.scenario['base'].addMaterial(MATERIALS[mat], file=MATERIALBASELINE)
r1.createScenario(name='high', file=MODULEBASELINE_High)
for mat in range (0, len(MATERIALS)):
MATERIALBASELINE = r'..\..\baselines\baseline_material_'+MATERIALS[mat]+'.csv'
r1.scenario['high'].addMaterial(MATERIALS[mat], file=MATERIALBASELINE)
r2 = PV_ICE.Simulation(name='bifacialTrend', path=testfolder)
r2.createScenario(name='base', file=MODULEBASELINE)
MATERIALBASELINE = r'..\..\baselines\PVSC_2021\baseline_material_glass_bifacialTrend.csv'
r2.scenario['base'].addMaterial('glass', file=MATERIALBASELINE)
MATERIALBASELINE = r'..\..\baselines\PVSC_2021\baseline_material_aluminium_frames_bifacialTrend.csv'
r2.scenario['base'].addMaterial('aluminium_frames', file=MATERIALBASELINE)
for mat in range (1, len(MATERIALS)-1):
MATERIALBASELINE = r'..\..\baselines\baseline_material_'+MATERIALS[mat]+'.csv'
r2.scenario['base'].addMaterial(MATERIALS[mat], file=MATERIALBASELINE)
r2.createScenario(name='high', file=MODULEBASELINE_High)
MATERIALBASELINE = r'..\..\baselines\PVSC_2021\baseline_material_glass_bifacialTrend.csv'
r2.scenario['high'].addMaterial('glass', file=MATERIALBASELINE)
MATERIALBASELINE = r'..\..\baselines\PVSC_2021\baseline_material_aluminium_frames_bifacialTrend.csv'
r2.scenario['high'].addMaterial('aluminium_frames', file=MATERIALBASELINE)
for mat in range (1, len(MATERIALS)-1):
MATERIALBASELINE = r'..\..\baselines\baseline_material_'+MATERIALS[mat]+'.csv'
r2.scenario['high'].addMaterial(MATERIALS[mat], file=MATERIALBASELINE)
# Irena EL
r3 = PV_ICE.Simulation(name='Irena_EL', path=testfolder)
r3.createScenario(name='base', file=MODULEBASELINE)
r3.scenario['base'].data['mod_lifetime'] = 40
r3.scenario['base'].data['mod_MFG_eff'] = 100.0
for mat in range (0, len(MATERIALS)):
MATERIALBASELINE = r'..\..\baselines\baseline_material_'+MATERIALS[mat]+'.csv'
r3.scenario['base'].addMaterial(MATERIALS[mat], file=MATERIALBASELINE)
r3.scenario['base'].material[MATERIALS[mat]].materialdata['mat_MFG_eff'] = 100.0
r3.scenario['base'].material[MATERIALS[mat]].materialdata['mat_MFG_scrap_Recycled'] = 0.0
r3.createScenario(name='high', file=MODULEBASELINE_High)
r3.scenario['high'].data['mod_lifetime'] = 40
r3.scenario['high'].data['mod_MFG_eff'] = 100.0
for mat in range (0, len(MATERIALS)):
MATERIALBASELINE = r'..\..\baselines\baseline_material_'+MATERIALS[mat]+'.csv'
r3.scenario['high'].addMaterial(MATERIALS[mat], file=MATERIALBASELINE)
r3.scenario['high'].material[MATERIALS[mat]].materialdata['mat_MFG_eff'] = 100.0
r3.scenario['high'].material[MATERIALS[mat]].materialdata['mat_MFG_scrap_Recycled'] = 0.0
# Irena RL
r4 = PV_ICE.Simulation(name='Irena_RL', path=testfolder)
r4.createScenario(name='base', file=MODULEBASELINE)
r4.scenario['base'].data['mod_lifetime'] = 40
r4.scenario['base'].data['mod_MFG_eff'] = 100.0
for mat in range (0, len(MATERIALS)):
MATERIALBASELINE = r'..\..\baselines\baseline_material_'+MATERIALS[mat]+'.csv'
r4.scenario['base'].addMaterial(MATERIALS[mat], file=MATERIALBASELINE)
r4.scenario['base'].material[MATERIALS[mat]].materialdata['mat_MFG_eff'] = 100.0
r4.scenario['base'].material[MATERIALS[mat]].materialdata['mat_MFG_scrap_Recycled'] = 0.0
r4.createScenario(name='high', file=MODULEBASELINE_High)
r4.scenario['high'].data['mod_lifetime'] = 40
r4.scenario['high'].data['mod_MFG_eff'] = 100.0
for mat in range (0, len(MATERIALS)):
MATERIALBASELINE = r'..\..\baselines\baseline_material_'+MATERIALS[mat]+'.csv'
r4.scenario['high'].addMaterial(MATERIALS[mat], file=MATERIALBASELINE)
r4.scenario['high'].material[MATERIALS[mat]].materialdata['mat_MFG_eff'] = 100.0
r4.scenario['high'].material[MATERIALS[mat]].materialdata['mat_MFG_scrap_Recycled'] = 0.0
path = C:\Users\sayala\Documents\GitHub\CircularEconomy-MassFlowCalculator\PV_ICE\TEMP\ElectricFutures path = C:\Users\sayala\Documents\GitHub\CircularEconomy-MassFlowCalculator\PV_ICE\TEMP\ElectricFutures path = C:\Users\sayala\Documents\GitHub\CircularEconomy-MassFlowCalculator\PV_ICE\TEMP\ElectricFutures path = C:\Users\sayala\Documents\GitHub\CircularEconomy-MassFlowCalculator\PV_ICE\TEMP\ElectricFutures
r1.calculateMassFlow()
r2.calculateMassFlow()
weibullInputParams = {'alpha': 2.49, 'beta':30} # Early-loss scenario IRENA
r3.calculateMassFlow(weibullInputParams=weibullInputParams)
weibullInputParams = {'alpha': 5.3759, 'beta':30} # Regular-loss scenario IRENA
r4.calculateMassFlow(weibullInputParams=weibullInputParams)
Working on Scenario: base ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass ==> Working on Material : silver ==> Working on Material : silicon ==> Working on Material : copper ==> Working on Material : aluminium_frames Working on Scenario: high ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass ==> Working on Material : silver ==> Working on Material : silicon ==> Working on Material : copper ==> Working on Material : aluminium_frames Working on Scenario: base ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass ==> Working on Material : aluminium_frames ==> Working on Material : silver ==> Working on Material : silicon ==> Working on Material : copper Working on Scenario: high ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass ==> Working on Material : aluminium_frames ==> Working on Material : silver ==> Working on Material : silicon ==> Working on Material : copper Working on Scenario: base ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass ==> Working on Material : silver ==> Working on Material : silicon ==> Working on Material : copper ==> Working on Material : aluminium_frames Working on Scenario: high ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass ==> Working on Material : silver ==> Working on Material : silicon ==> Working on Material : copper ==> Working on Material : aluminium_frames Working on Scenario: base ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass ==> Working on Material : silver ==> Working on Material : silicon ==> Working on Material : copper ==> Working on Material : aluminium_frames Working on Scenario: high ******************** Finished Area+Power Generation Calculations ==> Working on Material : glass ==> Working on Material : silver ==> Working on Material : silicon ==> Working on Material : copper ==> Working on Material : aluminium_frames
objects = [r1, r2, r3, r4]
scenarios = ['base', 'high']
USyearly=pd.DataFrame()
keyword='mat_Total_Landfilled'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
# Loop over objects
for kk in range(0, len(objects)):
obj = objects[kk]
# Loop over Scenarios
for jj in range(0, len(scenarios)):
case = scenarios[jj]
for ii in range (0, len(materials)):
material = materials[ii]
foo = obj.scenario[case].material[material].materialdata[keyword].copy()
foo = foo.to_frame(name=material)
USyearly["Waste_"+material+'_'+obj.name+'_'+case] = foo[material]
filter_col = [col for col in USyearly if (col.startswith('Waste') and col.endswith(obj.name+'_'+case)) ]
USyearly['Waste_Module_'+obj.name+'_'+case] = USyearly[filter_col].sum(axis=1)
# Converting to grams to Tons.
USyearly.head(20)
| Waste_glass_PV_ICE_base | Waste_silicon_PV_ICE_base | Waste_silver_PV_ICE_base | Waste_copper_PV_ICE_base | Waste_aluminium_frames_PV_ICE_base | Waste_Module_PV_ICE_base | Waste_glass_PV_ICE_high | Waste_silicon_PV_ICE_high | Waste_silver_PV_ICE_high | Waste_copper_PV_ICE_high | ... | Waste_silver_Irena_RL_base | Waste_copper_Irena_RL_base | Waste_aluminium_frames_Irena_RL_base | Waste_Module_Irena_RL_base | Waste_glass_Irena_RL_high | Waste_silicon_Irena_RL_high | Waste_silver_Irena_RL_high | Waste_copper_Irena_RL_high | Waste_aluminium_frames_Irena_RL_high | Waste_Module_Irena_RL_high | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 3.557465e+07 | 7.064407e+07 | 1.903224e+05 | 2.848183e+03 | 3.797870e+06 | 1.102098e+08 | 3.557465e+07 | 7.064407e+07 | 1.903224e+05 | 2.848183e+03 | ... | 0.000000e+00 | 0.000000 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.000000 | 0.000000e+00 | 0.000000e+00 |
| 1 | 2.708324e+07 | 5.272248e+07 | 1.392646e+05 | 2.169933e+03 | 2.823082e+06 | 8.277023e+07 | 2.708324e+07 | 5.272248e+07 | 1.392646e+05 | 2.169933e+03 | ... | 1.008385e-01 | 0.006160 | 3.452903e+00 | 1.349190e+01 | 8.969129e+00 | 9.628666e-01 | 1.008385e-01 | 0.006160 | 3.452903e+00 | 1.349190e+01 |
| 2 | 3.215794e+07 | 6.125064e+07 | 1.590017e+05 | 2.609763e+03 | 3.015525e+06 | 9.658572e+07 | 3.215794e+07 | 6.125064e+07 | 1.590017e+05 | 2.609763e+03 | ... | 4.261066e+00 | 0.260495 | 1.459467e+02 | 5.704381e+02 | 3.792685e+02 | 4.070139e+01 | 4.261066e+00 | 0.260495 | 1.459467e+02 | 5.704381e+02 |
| 3 | 3.246804e+07 | 6.001756e+07 | 1.558401e+05 | 2.828400e+03 | 2.960336e+06 | 9.560460e+07 | 3.246804e+07 | 6.001756e+07 | 1.558401e+05 | 2.828400e+03 | ... | 4.017959e+01 | 2.462628 | 1.377322e+03 | 5.389715e+03 | 3.585469e+03 | 3.842814e+02 | 4.017959e+01 | 2.462628 | 1.377322e+03 | 5.389715e+03 |
| 4 | 4.681363e+07 | 8.317952e+07 | 2.210346e+05 | 4.625451e+03 | 4.447433e+06 | 1.346662e+08 | 4.681363e+07 | 8.317952e+07 | 2.210346e+05 | 4.625451e+03 | ... | 2.045301e+02 | 12.580665 | 7.011592e+03 | 2.750518e+04 | 1.831685e+04 | 1.959632e+03 | 2.045301e+02 | 12.580665 | 7.011592e+03 | 2.750518e+04 |
| 5 | 5.956584e+07 | 9.979721e+07 | 1.985433e+05 | 7.251887e+03 | 6.229870e+06 | 1.657987e+08 | 5.956584e+07 | 9.979721e+07 | 1.985433e+05 | 7.251887e+03 | ... | 7.384826e+02 | 45.616871 | 2.529173e+04 | 9.958229e+04 | 6.641599e+04 | 7.090471e+03 | 7.384826e+02 | 45.616871 | 2.529173e+04 | 9.958229e+04 |
| 6 | 8.272290e+07 | 1.292807e+08 | 2.979944e+05 | 1.239959e+04 | 9.677156e+06 | 2.219911e+08 | 8.272290e+07 | 1.292807e+08 | 2.979944e+05 | 1.239959e+04 | ... | 2.138385e+03 | 132.722250 | 7.311216e+04 | 2.892013e+05 | 1.932373e+05 | 2.058078e+04 | 2.138385e+03 | 132.722250 | 7.311216e+04 | 2.892013e+05 |
| 7 | 1.294118e+08 | 1.907181e+08 | 4.886206e+05 | 2.206772e+04 | 1.628803e+07 | 3.369286e+08 | 1.294118e+08 | 1.907181e+08 | 4.886206e+05 | 2.206772e+04 | ... | 5.307093e+03 | 331.248780 | 1.811314e+05 | 7.202829e+05 | 4.822824e+05 | 5.123076e+04 | 5.307093e+03 | 331.248780 | 1.811314e+05 | 7.202829e+05 |
| 8 | 1.887176e+08 | 2.607935e+08 | 7.523668e+05 | 3.646577e+04 | 2.571493e+07 | 4.760149e+08 | 1.887176e+08 | 2.607935e+08 | 7.523668e+05 | 3.646577e+04 | ... | 1.174804e+04 | 738.496774 | 4.005756e+05 | 1.602163e+06 | 1.075216e+06 | 1.138843e+05 | 1.174804e+04 | 738.496774 | 4.005756e+05 | 1.602163e+06 |
| 9 | 3.002429e+08 | 4.109054e+08 | 1.188847e+06 | 5.977646e+04 | 4.122395e+07 | 7.536209e+08 | 3.002429e+08 | 4.109054e+08 | 1.188847e+06 | 5.977646e+04 | ... | 2.380407e+04 | 1510.149065 | 8.121137e+05 | 3.268267e+06 | 2.198705e+06 | 2.321339e+05 | 2.380407e+04 | 1510.149065 | 8.121137e+05 | 3.268267e+06 |
| 10 | 9.712870e+08 | 5.421610e+08 | 8.669476e+06 | 5.191413e+05 | 2.973426e+08 | 1.819979e+09 | 3.351979e+08 | 4.738747e+08 | 1.518025e+06 | 8.225270e+04 | ... | 4.494534e+04 | 2884.826893 | 1.537328e+06 | 6.227186e+06 | 4.200171e+06 | 4.418569e+05 | 4.494534e+04 | 2884.826893 | 1.537328e+06 | 6.227186e+06 |
| 11 | 7.829401e+08 | 5.801720e+08 | 6.273556e+06 | 3.885719e+05 | 2.190589e+08 | 1.588833e+09 | 3.776974e+08 | 5.376871e+08 | 1.929576e+06 | 1.102368e+05 | ... | 8.010870e+04 | 5216.655640 | 2.753421e+06 | 1.122975e+07 | 7.595202e+06 | 7.957963e+05 | 8.010870e+04 | 5216.655640 | 2.753421e+06 | 1.122975e+07 |
| 12 | 8.236658e+08 | 1.729869e+09 | 1.644644e+06 | 7.743406e+04 | 6.319147e+07 | 2.618448e+09 | 9.823191e+08 | 1.746774e+09 | 3.402026e+06 | 1.864028e+05 | ... | 1.360825e+05 | 9017.821351 | 4.711651e+06 | 1.935562e+07 | 1.312952e+07 | 1.369349e+06 | 1.360825e+05 | 9017.821351 | 4.711651e+06 | 1.935562e+07 |
| 13 | 8.122343e+08 | 1.679519e+09 | 1.654403e+06 | 8.811729e+04 | 6.634735e+07 | 2.559843e+09 | 9.982478e+08 | 1.699330e+09 | 3.712867e+06 | 2.158780e+05 | ... | 2.219036e+05 | 15011.080777 | 7.758910e+06 | 3.211855e+07 | 2.185542e+07 | 2.267308e+06 | 2.219036e+05 | 15011.080777 | 7.758910e+06 | 3.211855e+07 |
| 14 | 1.124835e+09 | 2.248071e+09 | 2.274499e+06 | 1.340193e+05 | 9.566111e+07 | 3.470975e+09 | 1.320263e+09 | 2.268873e+09 | 4.434660e+06 | 2.682466e+05 | ... | 3.492110e+05 | 24192.335385 | 1.236155e+07 | 5.158888e+07 | 3.522289e+07 | 3.631043e+06 | 3.492110e+05 | 24192.335385 | 1.236155e+07 | 5.158888e+07 |
| 15 | 1.873490e+09 | 1.767385e+09 | 2.414865e+06 | 2.297470e+05 | 1.607333e+08 | 3.804254e+09 | 2.194582e+09 | 1.801678e+09 | 5.987860e+06 | 4.502842e+05 | ... | 5.325085e+05 | 37909.286827 | 1.913242e+07 | 8.054283e+07 | 5.519412e+07 | 5.645880e+06 | 5.325085e+05 | 37909.286827 | 1.913242e+07 | 8.054283e+07 |
| 16 | 4.424479e+09 | 4.194998e+09 | 4.456339e+06 | 4.923753e+05 | 3.555811e+08 | 8.980007e+09 | 4.604623e+09 | 4.213958e+09 | 6.402767e+06 | 6.161050e+05 | ... | 7.892351e+05 | 57958.731976 | 2.886041e+07 | 1.226407e+08 | 8.438515e+07 | 8.547926e+06 | 7.892351e+05 | 57958.731976 | 2.886041e+07 | 1.226407e+08 |
| 17 | 7.995833e+09 | 7.411307e+09 | 1.129163e+07 | 1.148255e+06 | 7.531884e+08 | 1.617277e+10 | 7.995833e+09 | 7.411307e+09 | 1.129163e+07 | 1.148255e+06 | ... | 1.139494e+06 | 86705.485873 | 4.254152e+07 | 1.826362e+08 | 1.262391e+08 | 1.262946e+07 | 1.139494e+06 | 86705.485873 | 4.254152e+07 | 1.826362e+08 |
| 18 | 1.012265e+10 | 8.928549e+09 | 1.107252e+07 | 1.382319e+06 | 7.971335e+08 | 1.986078e+10 | 1.012265e+10 | 8.928549e+09 | 1.107252e+07 | 1.382319e+06 | ... | 1.605300e+06 | 127248.593433 | 6.141906e+07 | 2.666632e+08 | 1.852679e+08 | 1.824366e+07 | 1.605300e+06 | 127248.593433 | 6.141906e+07 | 2.666632e+08 |
| 19 | 9.519222e+09 | 8.055741e+09 | 1.288704e+07 | 1.580862e+06 | 8.515391e+08 | 1.844097e+10 | 9.519222e+09 | 8.055741e+09 | 1.288704e+07 | 1.580862e+06 | ... | 2.209361e+06 | 183716.644821 | 8.706153e+07 | 3.827524e+08 | 2.674835e+08 | 2.581433e+07 | 2.209361e+06 | 183716.644821 | 8.706153e+07 | 3.827524e+08 |
20 rows × 48 columns
keyword='mat_Total_Landfilled'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
# Loop over objects
for kk in range(0, len(objects)):
obj = objects[kk]
# Loop over Scenarios
for jj in range(0, len(scenarios)):
case = scenarios[jj]
for ii in range (0, len(materials)):
material = materials[ii]
foo = obj.scenario[case].material[material].materialdata[keyword].copy()
foo = foo.to_frame(name=material)
USyearly["Waste_"+material+'_'+obj.name+'_'+case] = foo[material]
filter_col = [col for col in USyearly if (col.startswith('Waste') and col.endswith(obj.name+'_'+case)) ]
USyearly['Waste_Module_'+obj.name+'_'+case] = USyearly[filter_col].sum(axis=1)
# Converting to grams to Tons.
USyearly.head(20)
| Waste_glass_PV_ICE_base | Waste_silicon_PV_ICE_base | Waste_silver_PV_ICE_base | Waste_copper_PV_ICE_base | Waste_aluminium_frames_PV_ICE_base | Waste_Module_PV_ICE_base | Waste_glass_PV_ICE_high | Waste_silicon_PV_ICE_high | Waste_silver_PV_ICE_high | Waste_copper_PV_ICE_high | ... | Waste_silver_Irena_RL_base | Waste_copper_Irena_RL_base | Waste_aluminium_frames_Irena_RL_base | Waste_Module_Irena_RL_base | Waste_glass_Irena_RL_high | Waste_silicon_Irena_RL_high | Waste_silver_Irena_RL_high | Waste_copper_Irena_RL_high | Waste_aluminium_frames_Irena_RL_high | Waste_Module_Irena_RL_high | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 3.557465e+07 | 7.064407e+07 | 1.903224e+05 | 2.848183e+03 | 3.797870e+06 | 2.204195e+08 | 3.557465e+07 | 7.064407e+07 | 1.903224e+05 | 2.848183e+03 | ... | 0.000000e+00 | 0.000000 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.000000 | 0.000000e+00 | 0.000000e+00 |
| 1 | 2.708324e+07 | 5.272248e+07 | 1.392646e+05 | 2.169933e+03 | 2.823082e+06 | 1.655405e+08 | 2.708324e+07 | 5.272248e+07 | 1.392646e+05 | 2.169933e+03 | ... | 1.008385e-01 | 0.006160 | 3.452903e+00 | 2.698380e+01 | 8.969129e+00 | 9.628666e-01 | 1.008385e-01 | 0.006160 | 3.452903e+00 | 2.698380e+01 |
| 2 | 3.215794e+07 | 6.125064e+07 | 1.590017e+05 | 2.609763e+03 | 3.015525e+06 | 1.931714e+08 | 3.215794e+07 | 6.125064e+07 | 1.590017e+05 | 2.609763e+03 | ... | 4.261066e+00 | 0.260495 | 1.459467e+02 | 1.140876e+03 | 3.792685e+02 | 4.070139e+01 | 4.261066e+00 | 0.260495 | 1.459467e+02 | 1.140876e+03 |
| 3 | 3.246804e+07 | 6.001756e+07 | 1.558401e+05 | 2.828400e+03 | 2.960336e+06 | 1.912092e+08 | 3.246804e+07 | 6.001756e+07 | 1.558401e+05 | 2.828400e+03 | ... | 4.017959e+01 | 2.462628 | 1.377322e+03 | 1.077943e+04 | 3.585469e+03 | 3.842814e+02 | 4.017959e+01 | 2.462628 | 1.377322e+03 | 1.077943e+04 |
| 4 | 4.681363e+07 | 8.317952e+07 | 2.210346e+05 | 4.625451e+03 | 4.447433e+06 | 2.693325e+08 | 4.681363e+07 | 8.317952e+07 | 2.210346e+05 | 4.625451e+03 | ... | 2.045301e+02 | 12.580665 | 7.011592e+03 | 5.501037e+04 | 1.831685e+04 | 1.959632e+03 | 2.045301e+02 | 12.580665 | 7.011592e+03 | 5.501037e+04 |
| 5 | 5.956584e+07 | 9.979721e+07 | 1.985433e+05 | 7.251887e+03 | 6.229870e+06 | 3.315974e+08 | 5.956584e+07 | 9.979721e+07 | 1.985433e+05 | 7.251887e+03 | ... | 7.384826e+02 | 45.616871 | 2.529173e+04 | 1.991646e+05 | 6.641599e+04 | 7.090471e+03 | 7.384826e+02 | 45.616871 | 2.529173e+04 | 1.991646e+05 |
| 6 | 8.272290e+07 | 1.292807e+08 | 2.979944e+05 | 1.239959e+04 | 9.677156e+06 | 4.439823e+08 | 8.272290e+07 | 1.292807e+08 | 2.979944e+05 | 1.239959e+04 | ... | 2.138385e+03 | 132.722250 | 7.311216e+04 | 5.784027e+05 | 1.932373e+05 | 2.058078e+04 | 2.138385e+03 | 132.722250 | 7.311216e+04 | 5.784027e+05 |
| 7 | 1.294118e+08 | 1.907181e+08 | 4.886206e+05 | 2.206772e+04 | 1.628803e+07 | 6.738573e+08 | 1.294118e+08 | 1.907181e+08 | 4.886206e+05 | 2.206772e+04 | ... | 5.307093e+03 | 331.248780 | 1.811314e+05 | 1.440566e+06 | 4.822824e+05 | 5.123076e+04 | 5.307093e+03 | 331.248780 | 1.811314e+05 | 1.440566e+06 |
| 8 | 1.887176e+08 | 2.607935e+08 | 7.523668e+05 | 3.646577e+04 | 2.571493e+07 | 9.520297e+08 | 1.887176e+08 | 2.607935e+08 | 7.523668e+05 | 3.646577e+04 | ... | 1.174804e+04 | 738.496774 | 4.005756e+05 | 3.204325e+06 | 1.075216e+06 | 1.138843e+05 | 1.174804e+04 | 738.496774 | 4.005756e+05 | 3.204325e+06 |
| 9 | 3.002429e+08 | 4.109054e+08 | 1.188847e+06 | 5.977646e+04 | 4.122395e+07 | 1.507242e+09 | 3.002429e+08 | 4.109054e+08 | 1.188847e+06 | 5.977646e+04 | ... | 2.380407e+04 | 1510.149065 | 8.121137e+05 | 6.536534e+06 | 2.198705e+06 | 2.321339e+05 | 2.380407e+04 | 1510.149065 | 8.121137e+05 | 6.536534e+06 |
| 10 | 9.712870e+08 | 5.421610e+08 | 8.669476e+06 | 5.191413e+05 | 2.973426e+08 | 3.639958e+09 | 3.351979e+08 | 4.738747e+08 | 1.518025e+06 | 8.225270e+04 | ... | 4.494534e+04 | 2884.826893 | 1.537328e+06 | 1.245437e+07 | 4.200171e+06 | 4.418569e+05 | 4.494534e+04 | 2884.826893 | 1.537328e+06 | 1.245437e+07 |
| 11 | 7.829401e+08 | 5.801720e+08 | 6.273556e+06 | 3.885719e+05 | 2.190589e+08 | 3.177666e+09 | 3.776974e+08 | 5.376871e+08 | 1.929576e+06 | 1.102368e+05 | ... | 8.010870e+04 | 5216.655640 | 2.753421e+06 | 2.245949e+07 | 7.595202e+06 | 7.957963e+05 | 8.010870e+04 | 5216.655640 | 2.753421e+06 | 2.245949e+07 |
| 12 | 8.236658e+08 | 1.729869e+09 | 1.644644e+06 | 7.743406e+04 | 6.319147e+07 | 5.236896e+09 | 9.823191e+08 | 1.746774e+09 | 3.402026e+06 | 1.864028e+05 | ... | 1.360825e+05 | 9017.821351 | 4.711651e+06 | 3.871124e+07 | 1.312952e+07 | 1.369349e+06 | 1.360825e+05 | 9017.821351 | 4.711651e+06 | 3.871124e+07 |
| 13 | 8.122343e+08 | 1.679519e+09 | 1.654403e+06 | 8.811729e+04 | 6.634735e+07 | 5.119685e+09 | 9.982478e+08 | 1.699330e+09 | 3.712867e+06 | 2.158780e+05 | ... | 2.219036e+05 | 15011.080777 | 7.758910e+06 | 6.423710e+07 | 2.185542e+07 | 2.267308e+06 | 2.219036e+05 | 15011.080777 | 7.758910e+06 | 6.423710e+07 |
| 14 | 1.124835e+09 | 2.248071e+09 | 2.274499e+06 | 1.340193e+05 | 9.566111e+07 | 6.941951e+09 | 1.320263e+09 | 2.268873e+09 | 4.434660e+06 | 2.682466e+05 | ... | 3.492110e+05 | 24192.335385 | 1.236155e+07 | 1.031778e+08 | 3.522289e+07 | 3.631043e+06 | 3.492110e+05 | 24192.335385 | 1.236155e+07 | 1.031778e+08 |
| 15 | 1.873490e+09 | 1.767385e+09 | 2.414865e+06 | 2.297470e+05 | 1.607333e+08 | 7.608507e+09 | 2.194582e+09 | 1.801678e+09 | 5.987860e+06 | 4.502842e+05 | ... | 5.325085e+05 | 37909.286827 | 1.913242e+07 | 1.610857e+08 | 5.519412e+07 | 5.645880e+06 | 5.325085e+05 | 37909.286827 | 1.913242e+07 | 1.610857e+08 |
| 16 | 4.424479e+09 | 4.194998e+09 | 4.456339e+06 | 4.923753e+05 | 3.555811e+08 | 1.796001e+10 | 4.604623e+09 | 4.213958e+09 | 6.402767e+06 | 6.161050e+05 | ... | 7.892351e+05 | 57958.731976 | 2.886041e+07 | 2.452814e+08 | 8.438515e+07 | 8.547926e+06 | 7.892351e+05 | 57958.731976 | 2.886041e+07 | 2.452814e+08 |
| 17 | 7.995833e+09 | 7.411307e+09 | 1.129163e+07 | 1.148255e+06 | 7.531884e+08 | 3.234554e+10 | 7.995833e+09 | 7.411307e+09 | 1.129163e+07 | 1.148255e+06 | ... | 1.139494e+06 | 86705.485873 | 4.254152e+07 | 3.652725e+08 | 1.262391e+08 | 1.262946e+07 | 1.139494e+06 | 86705.485873 | 4.254152e+07 | 3.652725e+08 |
| 18 | 1.012265e+10 | 8.928549e+09 | 1.107252e+07 | 1.382319e+06 | 7.971335e+08 | 3.972157e+10 | 1.012265e+10 | 8.928549e+09 | 1.107252e+07 | 1.382319e+06 | ... | 1.605300e+06 | 127248.593433 | 6.141906e+07 | 5.333264e+08 | 1.852679e+08 | 1.824366e+07 | 1.605300e+06 | 127248.593433 | 6.141906e+07 | 5.333264e+08 |
| 19 | 9.519222e+09 | 8.055741e+09 | 1.288704e+07 | 1.580862e+06 | 8.515391e+08 | 3.688194e+10 | 9.519222e+09 | 8.055741e+09 | 1.288704e+07 | 1.580862e+06 | ... | 2.209361e+06 | 183716.644821 | 8.706153e+07 | 7.655048e+08 | 2.674835e+08 | 2.581433e+07 | 2.209361e+06 | 183716.644821 | 8.706153e+07 | 7.655048e+08 |
20 rows × 48 columns
keyword='mat_Total_EOL_Landfilled'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
# Loop over objects
for kk in range(0, len(objects)):
obj = objects[kk]
# Loop over Scenarios
for jj in range(0, len(scenarios)):
case = scenarios[jj]
for ii in range (0, len(materials)):
material = materials[ii]
foo = obj.scenario[case].material[material].materialdata[keyword].copy()
foo = foo.to_frame(name=material)
USyearly["Waste_EOL_"+material+'_'+obj.name+'_'+case] = foo[material]
filter_col = [col for col in USyearly if (col.startswith('Waste') and col.endswith(obj.name+'_'+case)) ]
USyearly['Waste_EOL_Module_'+obj.name+'_'+case] = USyearly[filter_col].sum(axis=1)
# Converting to grams to Tons.
USyearly.head(20)
| Waste_glass_PV_ICE_base | Waste_silicon_PV_ICE_base | Waste_silver_PV_ICE_base | Waste_copper_PV_ICE_base | Waste_aluminium_frames_PV_ICE_base | Waste_Module_PV_ICE_base | Waste_glass_PV_ICE_high | Waste_silicon_PV_ICE_high | Waste_silver_PV_ICE_high | Waste_copper_PV_ICE_high | ... | Waste_EOL_silver_Irena_RL_base | Waste_EOL_copper_Irena_RL_base | Waste_EOL_aluminium_frames_Irena_RL_base | Waste_EOL_Module_Irena_RL_base | Waste_EOL_glass_Irena_RL_high | Waste_EOL_silicon_Irena_RL_high | Waste_EOL_silver_Irena_RL_high | Waste_EOL_copper_Irena_RL_high | Waste_EOL_aluminium_frames_Irena_RL_high | Waste_EOL_Module_Irena_RL_high | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 3.557465e+07 | 7.064407e+07 | 1.903224e+05 | 2.848183e+03 | 3.797870e+06 | 2.204195e+08 | 3.557465e+07 | 7.064407e+07 | 1.903224e+05 | 2.848183e+03 | ... | 0.000000e+00 | 0.000000 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.000000 | 0.000000e+00 | 0.000000e+00 |
| 1 | 2.708324e+07 | 5.272248e+07 | 1.392646e+05 | 2.169933e+03 | 2.823082e+06 | 1.655405e+08 | 2.708324e+07 | 5.272248e+07 | 1.392646e+05 | 2.169933e+03 | ... | 1.008385e-01 | 0.006160 | 3.452903e+00 | 5.396759e+01 | 8.969129e+00 | 9.628666e-01 | 1.008385e-01 | 0.006160 | 3.452903e+00 | 5.396759e+01 |
| 2 | 3.215794e+07 | 6.125064e+07 | 1.590017e+05 | 2.609763e+03 | 3.015525e+06 | 1.931714e+08 | 3.215794e+07 | 6.125064e+07 | 1.590017e+05 | 2.609763e+03 | ... | 4.261066e+00 | 0.260495 | 1.459467e+02 | 2.281752e+03 | 3.792685e+02 | 4.070139e+01 | 4.261066e+00 | 0.260495 | 1.459467e+02 | 2.281752e+03 |
| 3 | 3.246804e+07 | 6.001756e+07 | 1.558401e+05 | 2.828400e+03 | 2.960336e+06 | 1.912092e+08 | 3.246804e+07 | 6.001756e+07 | 1.558401e+05 | 2.828400e+03 | ... | 4.017959e+01 | 2.462628 | 1.377322e+03 | 2.155886e+04 | 3.585469e+03 | 3.842814e+02 | 4.017959e+01 | 2.462628 | 1.377322e+03 | 2.155886e+04 |
| 4 | 4.681363e+07 | 8.317952e+07 | 2.210346e+05 | 4.625451e+03 | 4.447433e+06 | 2.693325e+08 | 4.681363e+07 | 8.317952e+07 | 2.210346e+05 | 4.625451e+03 | ... | 2.045301e+02 | 12.580665 | 7.011592e+03 | 1.100207e+05 | 1.831685e+04 | 1.959632e+03 | 2.045301e+02 | 12.580665 | 7.011592e+03 | 1.100207e+05 |
| 5 | 5.956584e+07 | 9.979721e+07 | 1.985433e+05 | 7.251887e+03 | 6.229870e+06 | 3.315974e+08 | 5.956584e+07 | 9.979721e+07 | 1.985433e+05 | 7.251887e+03 | ... | 7.384826e+02 | 45.616871 | 2.529173e+04 | 3.983292e+05 | 6.641599e+04 | 7.090471e+03 | 7.384826e+02 | 45.616871 | 2.529173e+04 | 3.983292e+05 |
| 6 | 8.272290e+07 | 1.292807e+08 | 2.979944e+05 | 1.239959e+04 | 9.677156e+06 | 4.439823e+08 | 8.272290e+07 | 1.292807e+08 | 2.979944e+05 | 1.239959e+04 | ... | 2.138385e+03 | 132.722250 | 7.311216e+04 | 1.156805e+06 | 1.932373e+05 | 2.058078e+04 | 2.138385e+03 | 132.722250 | 7.311216e+04 | 1.156805e+06 |
| 7 | 1.294118e+08 | 1.907181e+08 | 4.886206e+05 | 2.206772e+04 | 1.628803e+07 | 6.738573e+08 | 1.294118e+08 | 1.907181e+08 | 4.886206e+05 | 2.206772e+04 | ... | 5.307093e+03 | 331.248780 | 1.811314e+05 | 2.881132e+06 | 4.822824e+05 | 5.123076e+04 | 5.307093e+03 | 331.248780 | 1.811314e+05 | 2.881132e+06 |
| 8 | 1.887176e+08 | 2.607935e+08 | 7.523668e+05 | 3.646577e+04 | 2.571493e+07 | 9.520297e+08 | 1.887176e+08 | 2.607935e+08 | 7.523668e+05 | 3.646577e+04 | ... | 1.174804e+04 | 738.496774 | 4.005756e+05 | 6.408650e+06 | 1.075216e+06 | 1.138843e+05 | 1.174804e+04 | 738.496774 | 4.005756e+05 | 6.408650e+06 |
| 9 | 3.002429e+08 | 4.109054e+08 | 1.188847e+06 | 5.977646e+04 | 4.122395e+07 | 1.507242e+09 | 3.002429e+08 | 4.109054e+08 | 1.188847e+06 | 5.977646e+04 | ... | 2.380407e+04 | 1510.149065 | 8.121137e+05 | 1.307307e+07 | 2.198705e+06 | 2.321339e+05 | 2.380407e+04 | 1510.149065 | 8.121137e+05 | 1.307307e+07 |
| 10 | 9.712870e+08 | 5.421610e+08 | 8.669476e+06 | 5.191413e+05 | 2.973426e+08 | 3.639958e+09 | 3.351979e+08 | 4.738747e+08 | 1.518025e+06 | 8.225270e+04 | ... | 4.494534e+04 | 2884.826893 | 1.537328e+06 | 2.490874e+07 | 4.200171e+06 | 4.418569e+05 | 4.494534e+04 | 2884.826893 | 1.537328e+06 | 2.490874e+07 |
| 11 | 7.829401e+08 | 5.801720e+08 | 6.273556e+06 | 3.885719e+05 | 2.190589e+08 | 3.177666e+09 | 3.776974e+08 | 5.376871e+08 | 1.929576e+06 | 1.102368e+05 | ... | 8.010870e+04 | 5216.655640 | 2.753421e+06 | 4.491898e+07 | 7.595202e+06 | 7.957963e+05 | 8.010870e+04 | 5216.655640 | 2.753421e+06 | 4.491898e+07 |
| 12 | 8.236658e+08 | 1.729869e+09 | 1.644644e+06 | 7.743406e+04 | 6.319147e+07 | 5.236896e+09 | 9.823191e+08 | 1.746774e+09 | 3.402026e+06 | 1.864028e+05 | ... | 1.360825e+05 | 9017.821351 | 4.711651e+06 | 7.742248e+07 | 1.312952e+07 | 1.369349e+06 | 1.360825e+05 | 9017.821351 | 4.711651e+06 | 7.742248e+07 |
| 13 | 8.122343e+08 | 1.679519e+09 | 1.654403e+06 | 8.811729e+04 | 6.634735e+07 | 5.119685e+09 | 9.982478e+08 | 1.699330e+09 | 3.712867e+06 | 2.158780e+05 | ... | 2.219036e+05 | 15011.080777 | 7.758910e+06 | 1.284742e+08 | 2.185542e+07 | 2.267308e+06 | 2.219036e+05 | 15011.080777 | 7.758910e+06 | 1.284742e+08 |
| 14 | 1.124835e+09 | 2.248071e+09 | 2.274499e+06 | 1.340193e+05 | 9.566111e+07 | 6.941951e+09 | 1.320263e+09 | 2.268873e+09 | 4.434660e+06 | 2.682466e+05 | ... | 3.492110e+05 | 24192.335385 | 1.236155e+07 | 2.063555e+08 | 3.522289e+07 | 3.631043e+06 | 3.492110e+05 | 24192.335385 | 1.236155e+07 | 2.063555e+08 |
| 15 | 1.873490e+09 | 1.767385e+09 | 2.414865e+06 | 2.297470e+05 | 1.607333e+08 | 7.608507e+09 | 2.194582e+09 | 1.801678e+09 | 5.987860e+06 | 4.502842e+05 | ... | 5.325085e+05 | 37909.286827 | 1.913242e+07 | 3.221713e+08 | 5.519412e+07 | 5.645880e+06 | 5.325085e+05 | 37909.286827 | 1.913242e+07 | 3.221713e+08 |
| 16 | 4.424479e+09 | 4.194998e+09 | 4.456339e+06 | 4.923753e+05 | 3.555811e+08 | 1.796001e+10 | 4.604623e+09 | 4.213958e+09 | 6.402767e+06 | 6.161050e+05 | ... | 7.892351e+05 | 57958.731976 | 2.886041e+07 | 4.905627e+08 | 8.438515e+07 | 8.547926e+06 | 7.892351e+05 | 57958.731976 | 2.886041e+07 | 4.905627e+08 |
| 17 | 7.995833e+09 | 7.411307e+09 | 1.129163e+07 | 1.148255e+06 | 7.531884e+08 | 3.234554e+10 | 7.995833e+09 | 7.411307e+09 | 1.129163e+07 | 1.148255e+06 | ... | 1.139494e+06 | 86705.485873 | 4.254152e+07 | 7.305449e+08 | 1.262391e+08 | 1.262946e+07 | 1.139494e+06 | 86705.485873 | 4.254152e+07 | 7.305449e+08 |
| 18 | 1.012265e+10 | 8.928549e+09 | 1.107252e+07 | 1.382319e+06 | 7.971335e+08 | 3.972157e+10 | 1.012265e+10 | 8.928549e+09 | 1.107252e+07 | 1.382319e+06 | ... | 1.605300e+06 | 127248.593433 | 6.141906e+07 | 1.066653e+09 | 1.852679e+08 | 1.824366e+07 | 1.605300e+06 | 127248.593433 | 6.141906e+07 | 1.066653e+09 |
| 19 | 9.519222e+09 | 8.055741e+09 | 1.288704e+07 | 1.580862e+06 | 8.515391e+08 | 3.688194e+10 | 9.519222e+09 | 8.055741e+09 | 1.288704e+07 | 1.580862e+06 | ... | 2.209361e+06 | 183716.644821 | 8.706153e+07 | 1.531010e+09 | 2.674835e+08 | 2.581433e+07 | 2.209361e+06 | 183716.644821 | 8.706153e+07 | 1.531010e+09 |
20 rows × 96 columns
keyword='mat_Total_MFG_Landfilled'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
# Loop over objects
for kk in range(0, len(objects)):
obj = objects[kk]
# Loop over Scenarios
for jj in range(0, len(scenarios)):
case = scenarios[jj]
for ii in range (0, len(materials)):
material = materials[ii]
foo = obj.scenario[case].material[material].materialdata[keyword].copy()
foo = foo.to_frame(name=material)
USyearly["Waste_MFG_"+material+'_'+obj.name+'_'+case] = foo[material]
filter_col = [col for col in USyearly if (col.startswith('Waste') and col.endswith(obj.name+'_'+case)) ]
USyearly['Waste_MFG_Module_'+obj.name+'_'+case] = USyearly[filter_col].sum(axis=1)
# Converting to grams to Tons.
USyearly.head(20)
| Waste_glass_PV_ICE_base | Waste_silicon_PV_ICE_base | Waste_silver_PV_ICE_base | Waste_copper_PV_ICE_base | Waste_aluminium_frames_PV_ICE_base | Waste_Module_PV_ICE_base | Waste_glass_PV_ICE_high | Waste_silicon_PV_ICE_high | Waste_silver_PV_ICE_high | Waste_copper_PV_ICE_high | ... | Waste_MFG_silver_Irena_RL_base | Waste_MFG_copper_Irena_RL_base | Waste_MFG_aluminium_frames_Irena_RL_base | Waste_MFG_Module_Irena_RL_base | Waste_MFG_glass_Irena_RL_high | Waste_MFG_silicon_Irena_RL_high | Waste_MFG_silver_Irena_RL_high | Waste_MFG_copper_Irena_RL_high | Waste_MFG_aluminium_frames_Irena_RL_high | Waste_MFG_Module_Irena_RL_high | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 3.557465e+07 | 7.064407e+07 | 1.903224e+05 | 2.848183e+03 | 3.797870e+06 | 2.204195e+08 | 3.557465e+07 | 7.064407e+07 | 1.903224e+05 | 2.848183e+03 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 0.000000e+00 |
| 1 | 2.708324e+07 | 5.272248e+07 | 1.392646e+05 | 2.169933e+03 | 2.823082e+06 | 1.655405e+08 | 2.708324e+07 | 5.272248e+07 | 1.392646e+05 | 2.169933e+03 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 1.079352e+02 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 1.079352e+02 |
| 2 | 3.215794e+07 | 6.125064e+07 | 1.590017e+05 | 2.609763e+03 | 3.015525e+06 | 1.931714e+08 | 3.215794e+07 | 6.125064e+07 | 1.590017e+05 | 2.609763e+03 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 4.563505e+03 | 1.192093e-07 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 4.563505e+03 |
| 3 | 3.246804e+07 | 6.001756e+07 | 1.558401e+05 | 2.828400e+03 | 2.960336e+06 | 1.912092e+08 | 3.246804e+07 | 6.001756e+07 | 1.558401e+05 | 2.828400e+03 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 4.311772e+04 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 4.311772e+04 |
| 4 | 4.681363e+07 | 8.317952e+07 | 2.210346e+05 | 4.625451e+03 | 4.447433e+06 | 2.693325e+08 | 4.681363e+07 | 8.317952e+07 | 2.210346e+05 | 4.625451e+03 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 2.200415e+05 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 2.200415e+05 |
| 5 | 5.956584e+07 | 9.979721e+07 | 1.985433e+05 | 7.251887e+03 | 6.229870e+06 | 3.315974e+08 | 5.956584e+07 | 9.979721e+07 | 1.985433e+05 | 7.251887e+03 | ... | 0.0 | 1.164153e-10 | -5.960464e-08 | 7.966583e+05 | 0.000000e+00 | 0.000000e+00 | 0.0 | 1.164153e-10 | -5.960464e-08 | 7.966583e+05 |
| 6 | 8.272290e+07 | 1.292807e+08 | 2.979944e+05 | 1.239959e+04 | 9.677156e+06 | 4.439823e+08 | 8.272290e+07 | 1.292807e+08 | 2.979944e+05 | 1.239959e+04 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 2.313611e+06 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 2.313611e+06 |
| 7 | 1.294118e+08 | 1.907181e+08 | 4.886206e+05 | 2.206772e+04 | 1.628803e+07 | 6.738573e+08 | 1.294118e+08 | 1.907181e+08 | 4.886206e+05 | 2.206772e+04 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 5.762263e+06 | 0.000000e+00 | -2.980232e-08 | 0.0 | 0.000000e+00 | 0.000000e+00 | 5.762263e+06 |
| 8 | 1.887176e+08 | 2.607935e+08 | 7.523668e+05 | 3.646577e+04 | 2.571493e+07 | 9.520297e+08 | 1.887176e+08 | 2.607935e+08 | 7.523668e+05 | 3.646577e+04 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 1.281730e+07 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 1.281730e+07 |
| 9 | 3.002429e+08 | 4.109054e+08 | 1.188847e+06 | 5.977646e+04 | 4.122395e+07 | 1.507242e+09 | 3.002429e+08 | 4.109054e+08 | 1.188847e+06 | 5.977646e+04 | ... | 0.0 | 4.656613e-10 | 0.000000e+00 | 2.614614e+07 | 0.000000e+00 | 0.000000e+00 | 0.0 | 4.656613e-10 | 0.000000e+00 | 2.614614e+07 |
| 10 | 9.712870e+08 | 5.421610e+08 | 8.669476e+06 | 5.191413e+05 | 2.973426e+08 | 3.639958e+09 | 3.351979e+08 | 4.738747e+08 | 1.518025e+06 | 8.225270e+04 | ... | 0.0 | 0.000000e+00 | 2.384186e-07 | 4.981749e+07 | 0.000000e+00 | -5.960464e-08 | 0.0 | 0.000000e+00 | 2.384186e-07 | 4.981749e+07 |
| 11 | 7.829401e+08 | 5.801720e+08 | 6.273556e+06 | 3.885719e+05 | 2.190589e+08 | 3.177666e+09 | 3.776974e+08 | 5.376871e+08 | 1.929576e+06 | 1.102368e+05 | ... | 0.0 | 0.000000e+00 | 2.384186e-07 | 8.983796e+07 | 9.536743e-07 | 0.000000e+00 | 0.0 | 0.000000e+00 | 2.384186e-07 | 8.983796e+07 |
| 12 | 8.236658e+08 | 1.729869e+09 | 1.644644e+06 | 7.743406e+04 | 6.319147e+07 | 5.236896e+09 | 9.823191e+08 | 1.746774e+09 | 3.402026e+06 | 1.864028e+05 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 1.548450e+08 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 1.548450e+08 |
| 13 | 8.122343e+08 | 1.679519e+09 | 1.654403e+06 | 8.811729e+04 | 6.634735e+07 | 5.119685e+09 | 9.982478e+08 | 1.699330e+09 | 3.712867e+06 | 2.158780e+05 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 2.569484e+08 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 2.569484e+08 |
| 14 | 1.124835e+09 | 2.248071e+09 | 2.274499e+06 | 1.340193e+05 | 9.566111e+07 | 6.941951e+09 | 1.320263e+09 | 2.268873e+09 | 4.434660e+06 | 2.682466e+05 | ... | 0.0 | 1.862645e-09 | 0.000000e+00 | 4.127111e+08 | 0.000000e+00 | 0.000000e+00 | 0.0 | 1.862645e-09 | 0.000000e+00 | 4.127111e+08 |
| 15 | 1.873490e+09 | 1.767385e+09 | 2.414865e+06 | 2.297470e+05 | 1.607333e+08 | 7.608507e+09 | 2.194582e+09 | 1.801678e+09 | 5.987860e+06 | 4.502842e+05 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 6.443427e+08 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 6.443427e+08 |
| 16 | 4.424479e+09 | 4.194998e+09 | 4.456339e+06 | 4.923753e+05 | 3.555811e+08 | 1.796001e+10 | 4.604623e+09 | 4.213958e+09 | 6.402767e+06 | 6.161050e+05 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 9.811255e+08 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 9.811255e+08 |
| 17 | 7.995833e+09 | 7.411307e+09 | 1.129163e+07 | 1.148255e+06 | 7.531884e+08 | 3.234554e+10 | 7.995833e+09 | 7.411307e+09 | 1.129163e+07 | 1.148255e+06 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 1.461090e+09 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 1.461090e+09 |
| 18 | 1.012265e+10 | 8.928549e+09 | 1.107252e+07 | 1.382319e+06 | 7.971335e+08 | 3.972157e+10 | 1.012265e+10 | 8.928549e+09 | 1.107252e+07 | 1.382319e+06 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 2.133305e+09 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 2.133305e+09 |
| 19 | 9.519222e+09 | 8.055741e+09 | 1.288704e+07 | 1.580862e+06 | 8.515391e+08 | 3.688194e+10 | 9.519222e+09 | 8.055741e+09 | 1.288704e+07 | 1.580862e+06 | ... | 0.0 | 0.000000e+00 | 0.000000e+00 | 3.062019e+09 | 0.000000e+00 | 0.000000e+00 | 0.0 | 0.000000e+00 | 0.000000e+00 | 3.062019e+09 |
20 rows × 144 columns
keyword='mat_Virgin_Stock'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
# Loop over objects
for kk in range(0, len(objects)):
obj = objects[kk]
# Loop over Scenarios
for jj in range(0, len(scenarios)):
case = scenarios[jj]
for ii in range (0, len(materials)):
material = materials[ii]
foo = obj.scenario[case].material[material].materialdata[keyword].copy()
foo = foo.to_frame(name=material)
USyearly["VirginStock_"+material+'_'+obj.name+'_'+case] = foo[material]
filter_col = [col for col in USyearly if (col.startswith('VirginStock_') and col.endswith(obj.name+'_'+case)) ]
USyearly['VirginStock_Module_'+obj.name+'_'+case] = USyearly[filter_col].sum(axis=1)
USyearly = USyearly/1000000 # This is the ratio for Metric tonnes
#907185 -- this is for US tons
UScum = USyearly.copy()
UScum = UScum.cumsum()
UScum.head()
| Waste_glass_PV_ICE_base | Waste_silicon_PV_ICE_base | Waste_silver_PV_ICE_base | Waste_copper_PV_ICE_base | Waste_aluminium_frames_PV_ICE_base | Waste_Module_PV_ICE_base | Waste_glass_PV_ICE_high | Waste_silicon_PV_ICE_high | Waste_silver_PV_ICE_high | Waste_copper_PV_ICE_high | ... | VirginStock_silver_Irena_RL_base | VirginStock_copper_Irena_RL_base | VirginStock_aluminium_frames_Irena_RL_base | VirginStock_Module_Irena_RL_base | VirginStock_glass_Irena_RL_high | VirginStock_silicon_Irena_RL_high | VirginStock_silver_Irena_RL_high | VirginStock_copper_Irena_RL_high | VirginStock_aluminium_frames_Irena_RL_high | VirginStock_Module_Irena_RL_high | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 35.574651 | 70.644070 | 0.190322 | 0.002848 | 3.797870 | 220.419522 | 35.574651 | 70.644070 | 0.190322 | 0.002848 | ... | 8.800000 | 0.537600 | 309.118541 | 1203.298284 | 800.000000 | 84.842143 | 8.800000 | 0.537600 | 309.118541 | 1203.298284 |
| 1 | 62.657891 | 123.366547 | 0.329587 | 0.005018 | 6.620951 | 385.959989 | 62.657891 | 123.366547 | 0.329587 | 0.005018 | ... | 15.237861 | 0.946839 | 538.814426 | 2112.146469 | 1408.986877 | 148.160466 | 15.237861 | 0.946839 | 538.814426 | 2112.146469 |
| 2 | 94.815832 | 184.617192 | 0.488589 | 0.007628 | 9.636476 | 579.131434 | 94.815832 | 184.617192 | 0.488589 | 0.007628 | ... | 22.559618 | 1.431931 | 782.443304 | 3158.998914 | 2130.850231 | 221.713830 | 22.559618 | 1.431931 | 782.443304 | 3158.998914 |
| 3 | 127.283871 | 244.634747 | 0.644429 | 0.010456 | 12.596813 | 770.340632 | 127.283871 | 244.634747 | 0.644429 | 0.010456 | ... | 29.569970 | 1.916883 | 1011.602001 | 4189.338187 | 2852.504135 | 293.745199 | 29.569970 | 1.916883 | 1011.602001 | 4189.338187 |
| 4 | 174.097497 | 327.814264 | 0.865463 | 0.015082 | 17.044245 | 1039.673103 | 174.097497 | 327.814264 | 0.865463 | 0.015082 | ... | 39.043456 | 2.602472 | 1328.469742 | 5636.297721 | 3872.725681 | 393.456370 | 39.043456 | 2.602472 | 1328.469742 | 5636.297721 |
5 rows × 192 columns
keyword='Installed_Capacity_[W]'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
# Loop over SF Scenarios
for kk in range(0, len(objects)):
obj = objects[kk]
# Loop over Scenarios
for jj in range(0, len(scenarios)):
case = scenarios[jj]
foo = obj.scenario[case].data[keyword]
foo = foo.to_frame(name=keyword)
UScum["Capacity_"+obj.name+'_'+case] = foo[keyword]
UScum.tail(20)
| Waste_glass_PV_ICE_base | Waste_silicon_PV_ICE_base | Waste_silver_PV_ICE_base | Waste_copper_PV_ICE_base | Waste_aluminium_frames_PV_ICE_base | Waste_Module_PV_ICE_base | Waste_glass_PV_ICE_high | Waste_silicon_PV_ICE_high | Waste_silver_PV_ICE_high | Waste_copper_PV_ICE_high | ... | VirginStock_aluminium_frames_Irena_RL_high | VirginStock_Module_Irena_RL_high | Capacity_PV_ICE_base | Capacity_PV_ICE_high | Capacity_bifacialTrend_base | Capacity_bifacialTrend_high | Capacity_Irena_EL_base | Capacity_Irena_EL_high | Capacity_Irena_RL_base | Capacity_Irena_RL_high | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 36 | 7.056043e+05 | 314301.060424 | 642.670688 | 240.903227 | 86191.774810 | 2.213961e+06 | 1.078755e+06 | 5.261496e+05 | 710.661856 | 306.294586 | ... | 4.458324e+06 | 3.999241e+07 | 3.941273e+11 | 7.833385e+11 | 3.941273e+11 | 7.833385e+11 | 3.457297e+11 | 7.196379e+11 | 3.917708e+11 | 7.805246e+11 |
| 37 | 8.207424e+05 | 340182.059523 | 730.016950 | 303.121730 | 105940.097677 | 2.535795e+06 | 1.251880e+06 | 5.910551e+05 | 799.378007 | 374.349345 | ... | 5.115287e+06 | 4.665506e+07 | 4.391642e+11 | 9.142533e+11 | 4.391642e+11 | 9.142533e+11 | 3.807958e+11 | 8.340680e+11 | 4.357907e+11 | 9.099278e+11 |
| 38 | 9.228722e+05 | 358737.495813 | 797.395860 | 363.915263 | 123576.908589 | 2.812696e+06 | 1.416068e+06 | 6.417343e+05 | 891.598835 | 450.557001 | ... | 5.610336e+06 | 5.167879e+07 | 4.680245e+11 | 1.011295e+12 | 4.680245e+11 | 1.011295e+12 | 3.982125e+11 | 9.116719e+11 | 4.629294e+11 | 1.004880e+12 |
| 39 | 1.068318e+06 | 379482.238605 | 906.006306 | 456.411296 | 150425.555463 | 3.199177e+06 | 1.599940e+06 | 6.932022e+05 | 992.389263 | 542.458805 | ... | 6.102705e+06 | 5.667737e+07 | 4.958984e+11 | 1.107415e+12 | 4.958984e+11 | 1.107415e+12 | 4.139077e+11 | 9.850832e+11 | 4.890280e+11 | 1.098157e+12 |
| 40 | 1.234903e+06 | 396252.080126 | 1022.510904 | 570.654165 | 182101.797280 | 3.629701e+06 | 1.771494e+06 | 7.254170e+05 | 1094.108714 | 646.339604 | ... | 6.376334e+06 | 5.946193e+07 | 5.107564e+11 | 1.157235e+12 | 5.107564e+11 | 1.157235e+12 | 4.155981e+11 | 1.008615e+12 | 5.017031e+11 | 1.144188e+12 |
| 41 | 1.378401e+06 | 411711.266292 | 1098.674107 | 673.243942 | 205910.980659 | 3.995590e+06 | 1.970392e+06 | 7.588882e+05 | 1205.312525 | 773.177375 | ... | 6.648457e+06 | 6.223392e+07 | 5.258773e+11 | 1.206190e+12 | 5.258773e+11 | 1.206190e+12 | 4.155601e+11 | 1.027434e+12 | 5.131224e+11 | 1.188202e+12 |
| 42 | 1.653774e+06 | 433623.341467 | 1263.014301 | 870.515851 | 254843.394763 | 4.688748e+06 | 2.218322e+06 | 8.032971e+05 | 1331.769767 | 931.211690 | ... | 7.019983e+06 | 6.601620e+07 | 5.376112e+11 | 1.275546e+12 | 5.376112e+11 | 1.275546e+12 | 4.130338e+11 | 1.062612e+12 | 5.224069e+11 | 1.251248e+12 |
| 43 | 1.853240e+06 | 451468.759829 | 1364.148923 | 1023.674831 | 287513.675680 | 5.189221e+06 | 2.503983e+06 | 8.494163e+05 | 1472.776509 | 1122.454318 | ... | 7.389653e+06 | 6.978316e+07 | 5.506204e+11 | 1.343769e+12 | 5.506204e+11 | 1.343769e+12 | 4.088117e+11 | 1.092499e+12 | 5.302207e+11 | 1.311552e+12 |
| 44 | 2.119598e+06 | 485199.840883 | 1491.843262 | 1218.603579 | 329020.524716 | 5.873058e+06 | 2.791719e+06 | 8.751029e+05 | 1621.871378 | 1343.230754 | ... | 7.519303e+06 | 7.112197e+07 | 5.941573e+11 | 1.360009e+12 | 5.941573e+11 | 1.360009e+12 | 4.344354e+11 | 1.066180e+12 | 5.679651e+11 | 1.317963e+12 |
| 45 | 2.467883e+06 | 522926.919927 | 1666.275260 | 1477.378136 | 384922.232799 | 6.757752e+06 | 3.119713e+06 | 9.026029e+05 | 1786.758438 | 1602.076737 | ... | 7.648008e+06 | 7.245548e+07 | 6.358827e+11 | 1.375256e+12 | 6.358827e+11 | 1.375256e+12 | 4.583889e+11 | 1.034625e+12 | 6.039727e+11 | 1.321085e+12 |
| 46 | 2.763511e+06 | 545452.357933 | 1809.374633 | 1721.809723 | 432150.246263 | 7.489290e+06 | 3.507948e+06 | 9.459751e+05 | 1969.148193 | 1901.422098 | ... | 7.929902e+06 | 7.534581e+07 | 6.469407e+11 | 1.422739e+12 | 6.469407e+11 | 1.422739e+12 | 4.498553e+11 | 1.031129e+12 | 6.072739e+11 | 1.353684e+12 |
| 47 | 3.082235e+06 | 568893.638162 | 1961.187575 | 1990.088192 | 482513.034682 | 8.275186e+06 | 3.923872e+06 | 9.902728e+05 | 2158.242170 | 2231.863166 | ... | 8.210312e+06 | 7.822607e+07 | 6.574131e+11 | 1.469381e+12 | 6.574131e+11 | 1.469381e+12 | 4.400262e+11 | 1.022840e+12 | 6.089018e+11 | 1.382206e+12 |
| 48 | 3.447926e+06 | 602353.168179 | 2129.249544 | 2290.428443 | 538675.855773 | 9.186750e+06 | 4.360538e+06 | 1.033219e+06 | 2349.962828 | 2590.455992 | ... | 8.468320e+06 | 8.088457e+07 | 6.873293e+11 | 1.510703e+12 | 6.873293e+11 | 1.510703e+12 | 4.492858e+11 | 1.005786e+12 | 6.290597e+11 | 1.401814e+12 |
| 49 | 3.818778e+06 | 635647.871404 | 2292.504466 | 2601.865129 | 594261.561819 | 1.010716e+07 | 4.819649e+06 | 1.076511e+06 | 2541.194567 | 2977.166374 | ... | 8.724942e+06 | 8.353439e+07 | 7.169444e+11 | 1.551274e+12 | 7.169444e+11 | 1.551274e+12 | 4.576313e+11 | 9.852939e+11 | 6.475417e+11 | 1.416833e+12 |
| 50 | 4.126915e+06 | 662175.448352 | 2418.133966 | 2872.015472 | 638273.336940 | 1.086531e+07 | 5.326742e+06 | 1.127069e+06 | 2739.282338 | 3405.882554 | ... | 9.048486e+06 | 8.686771e+07 | 7.399609e+11 | 1.605649e+12 | 7.399609e+11 | 1.605649e+12 | 4.577381e+11 | 9.771753e+11 | 6.568102e+11 | 1.441951e+12 |
| 51 | 4.472895e+06 | 690007.061114 | 2553.927437 | 3177.348432 | 687115.209677 | 1.171150e+07 | 5.894137e+06 | 1.179452e+06 | 2950.394949 | 3894.398594 | ... | 9.370511e+06 | 9.019104e+07 | 7.620580e+11 | 1.658458e+12 | 7.620580e+11 | 1.658458e+12 | 4.574685e+11 | 9.676339e+11 | 6.645148e+11 | 1.462171e+12 |
| 52 | 4.843828e+06 | 723059.434807 | 2688.785236 | 3500.325645 | 737507.974883 | 1.262117e+07 | 6.566642e+06 | 1.245371e+06 | 3188.124638 | 4469.756177 | ... | 9.804855e+06 | 9.465783e+07 | 7.957611e+11 | 1.734025e+12 | 7.957611e+11 | 1.734025e+12 | 4.691530e+11 | 9.826627e+11 | 6.827827e+11 | 1.502259e+12 |
| 53 | 5.272763e+06 | 758179.694619 | 2840.174036 | 3876.983403 | 795430.597242 | 1.366618e+07 | 7.359891e+06 | 1.315671e+06 | 3462.271111 | 5157.792631 | ... | 1.023745e+07 | 9.911228e+07 | 8.280961e+11 | 1.806696e+12 | 8.280961e+11 | 1.806696e+12 | 4.808609e+11 | 9.983826e+11 | 6.995041e+11 | 1.537158e+12 |
| 54 | 5.784093e+06 | 803598.572859 | 3015.442309 | 4320.032549 | 863485.041738 | 1.491702e+07 | 8.297148e+06 | 1.392437e+06 | 3781.152979 | 5978.402136 | ... | 1.068079e+07 | 1.036812e+08 | 8.770550e+11 | 1.878772e+12 | 8.770550e+11 | 1.878772e+12 | 5.109220e+11 | 1.018416e+12 | 7.328876e+11 | 1.569497e+12 |
| 55 | 6.362243e+06 | 851461.865125 | 3210.823170 | 4824.982492 | 940348.779747 | 1.632418e+07 | 9.370630e+06 | 1.474253e+06 | 4141.516269 | 6924.875672 | ... | 1.112241e+07 | 1.082383e+08 | 9.243998e+11 | 1.947649e+12 | 9.243998e+11 | 1.947649e+12 | 5.410761e+11 | 1.040647e+12 | 7.646611e+11 | 1.596522e+12 |
20 rows × 200 columns
USyearly.index = r1.scenario['base'].data['year']
UScum.index = r1.scenario['base'].data['year']
mining2020_aluminum = 65267000
mining2020_silver = 22260
mining2020_copper = 20000000
mining2020_silicon = 8000000
USyearly.keys()
Index(['Waste_glass_PV_ICE_base', 'Waste_silicon_PV_ICE_base',
'Waste_silver_PV_ICE_base', 'Waste_copper_PV_ICE_base',
'Waste_aluminium_frames_PV_ICE_base', 'Waste_Module_PV_ICE_base',
'Waste_glass_PV_ICE_high', 'Waste_silicon_PV_ICE_high',
'Waste_silver_PV_ICE_high', 'Waste_copper_PV_ICE_high',
...
'VirginStock_silver_Irena_RL_base', 'VirginStock_copper_Irena_RL_base',
'VirginStock_aluminium_frames_Irena_RL_base',
'VirginStock_Module_Irena_RL_base', 'VirginStock_glass_Irena_RL_high',
'VirginStock_silicon_Irena_RL_high', 'VirginStock_silver_Irena_RL_high',
'VirginStock_copper_Irena_RL_high',
'VirginStock_aluminium_frames_Irena_RL_high',
'VirginStock_Module_Irena_RL_high'],
dtype='object', length=192)
plt.rcParams.update({'font.size': 10})
plt.rcParams['figure.figsize'] = (12, 8)
keyw='VirginStock_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
fig, axs = plt.subplots(1,1, figsize=(4, 6), facecolor='w', edgecolor='k')
fig.subplots_adjust(hspace = .3, wspace=.2)
# Loop over CASES
name2 = 'PV_ICE_high'
name0 = 'PV_ICE_base'
# ROW 2, Aluminum and Silicon: g- 4 aluminum k - 1 silicon orange - 3 copper gray - 2 silver
axs.plot(USyearly[keyw+materials[2]+'_'+name2]*100/mining2020_silver,
color = 'gray', linewidth=2.0, label='Silver')
axs.fill_between(USyearly.index, USyearly[keyw+materials[2]+'_'+name0]*100/mining2020_silver, USyearly[keyw+materials[2]+'_'+name2]*100/mining2020_silver,
color='gray', lw=3, alpha=.3)
axs.plot(USyearly[keyw+materials[1]+'_'+name2]*100/mining2020_silicon,
color = 'k', linewidth=2.0, label='Silicon')
axs.fill_between(USyearly.index, USyearly[keyw+materials[1]+'_'+name0]*100/mining2020_silicon,
USyearly[keyw+materials[1]+'_'+name2]*100/mining2020_silicon,
color='k', lw=3, alpha=.5)
axs.plot(USyearly[keyw+materials[4]+'_'+name2]*100/mining2020_aluminum,
color = 'g', linewidth=2.0, label='Aluminum')
axs.fill_between(USyearly.index, USyearly[keyw+materials[4]+'_'+name0]*100/mining2020_aluminum,
USyearly[keyw+materials[4]+'_'+name2]*100/mining2020_aluminum,
color='g', lw=3, alpha=.3)
axs.plot(USyearly[keyw+materials[3]+'_'+name2]*100/mining2020_copper,
color = 'orange', linewidth=2.0, label='Copper')
axs.fill_between(USyearly.index, USyearly[keyw+materials[3]+'_'+name0]*100/mining2020_copper,
USyearly[keyw+materials[3]+'_'+name2]*100/mining2020_copper,
color='orange', lw=3, alpha=.3)
axs.set_xlim([2020,2050])
axs.legend()
#axs.set_yscale('log')
axs.set_ylabel('Virgin material needs as a percentage of \n 2020 global mining production capacity [%]')
fig.savefig(os.path.join(testfolder,'Fig_1x1_MaterialNeeds Ratio to Production_NREL2018.png'), dpi=600)
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='VirginStock_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
########################
# SUBPLOT 1
########################
#######################
# Loop over CASES
name2 = 'PV_ICE_high'
name0 = 'PV_ICE_base'
# SCENARIO 1 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name0]+USyearly[keyw+materials[1]+'_'+name0]+
USyearly[keyw+materials[2]+'_'+name0]+USyearly[keyw+materials[3]+'_'+name0]+
USyearly[keyw+materials[4]+'_'+name0])
glassmat = (USyearly[keyw+materials[0]+'_'+name0])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'k.', linewidth=5, label='S1: '+name0+' module mass')
a0.plot(USyearly.index, glassmat, 'k', linewidth=5, label='S1: '+name0+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name2]+USyearly[keyw+materials[1]+'_'+name2]+
USyearly[keyw+materials[2]+'_'+name2]+USyearly[keyw+materials[3]+'_'+name2]+
USyearly[keyw+materials[4]+'_'+name2])
glassmat = (USyearly[keyw+materials[0]+'_'+name2])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'c.', linewidth=5, label='S2: '+name2+' module mass')
a0.plot(USyearly.index, glassmat, 'c', linewidth=5, label='S2: '+name2+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
a0.legend()
a0.set_title('Yearly Virgin Material Needs by Scenario')
a0.set_ylabel('Mass [Million Tonnes]')
a0.set_xlim([2020, 2050])
a0.set_xlabel('Years')
########################
# SUBPLOT 2
########################
#######################
# Calculate
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['bottom1'] = dfcumulations2050['glass']
dfcumulations2050['bottom2'] = dfcumulations2050['bottom1']+dfcumulations2050['aluminium_frames']
dfcumulations2050['bottom3'] = dfcumulations2050['bottom2']+dfcumulations2050['silicon']
dfcumulations2050['bottom4'] = dfcumulations2050['bottom3']+dfcumulations2050['copper']
## Plot BARS Stuff
ind=np.arange(2)
width=0.35 # width of the bars.
p0 = a1.bar(ind, dfcumulations2050['glass'], width, color='c')
p1 = a1.bar(ind, dfcumulations2050['aluminium_frames'], width,
bottom=dfcumulations2050['bottom1'])
p2 = a1.bar(ind, dfcumulations2050['silicon'], width,
bottom=dfcumulations2050['bottom2'])
p3 = a1.bar(ind, dfcumulations2050['copper'], width,
bottom=dfcumulations2050['bottom3'])
p4 = a1.bar(ind, dfcumulations2050['silver'], width,
bottom=dfcumulations2050['bottom4'])
a1.yaxis.set_label_position("right")
a1.yaxis.tick_right()
a1.set_ylabel('Virgin Material Cumulative Needs 2020-2050 [Million Tonnes]')
a1.set_xlabel('Scenario')
a1.set_xticks(ind, ('S1', 'S2'))
#plt.yticks(np.arange(0, 81, 10))
a1.legend((p0[0], p1[0], p2[0], p3[0], p4[0] ), ('Glass', 'aluminium_frames', 'Silicon','Copper','Silver'))
f.tight_layout()
fig.savefig(os.path.join(testfolder,'Fig_2x1_Yearly Virgin Material Needs by Scenario and Cumulatives_NREL2018.png'), dpi=600)
print("Cumulative Virgin Needs by 2050 Million Tones by Scenario")
dfcumulations2050[['glass','silicon','silver','copper','aluminium_frames']].sum(axis=1)
C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py:89: MatplotlibDeprecationWarning: Passing the minor parameter of set_ticks() positionally is deprecated since Matplotlib 3.2; the parameter will become keyword-only two minor releases later.
Cumulative Virgin Needs by 2050 Million Tones by Scenario
0 55.813184 1 113.089407 dtype: float64
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='Waste_EOL_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
########################
# SUBPLOT 1
########################
#######################
# Loop over CASES
name2 = 'PV_ICE_high'
name0 = 'PV_ICE_base'
# SCENARIO 1 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name0]+USyearly[keyw+materials[1]+'_'+name0]+
USyearly[keyw+materials[2]+'_'+name0]+USyearly[keyw+materials[3]+'_'+name0]+
USyearly[keyw+materials[4]+'_'+name0])
glassmat = (USyearly[keyw+materials[0]+'_'+name0])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'k.', linewidth=5, label='S1: '+name0+' module mass')
a0.plot(USyearly.index, glassmat, 'k', linewidth=5, label='S1: '+name0+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name2]+USyearly[keyw+materials[1]+'_'+name2]+
USyearly[keyw+materials[2]+'_'+name2]+USyearly[keyw+materials[3]+'_'+name2]+
USyearly[keyw+materials[4]+'_'+name2])
glassmat = (USyearly[keyw+materials[0]+'_'+name2])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'c.', linewidth=5, label='S2: '+name2+' module mass')
a0.plot(USyearly.index, glassmat, 'c', linewidth=5, label='S2: '+name2+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
a0.legend()
a0.set_title('Yearly End of Life Material by Scenario')
a0.set_ylabel('Mass [Million Tonnes]')
a0.set_xlim([2020, 2050])
a0.set_xlabel('Years')
########################
# SUBPLOT 2
########################
#######################
# Calculate
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['bottom1'] = dfcumulations2050['glass']
dfcumulations2050['bottom2'] = dfcumulations2050['bottom1']+dfcumulations2050['aluminium_frames']
dfcumulations2050['bottom3'] = dfcumulations2050['bottom2']+dfcumulations2050['silicon']
dfcumulations2050['bottom4'] = dfcumulations2050['bottom3']+dfcumulations2050['copper']
## Plot BARS Stuff
ind=np.arange(2)
width=0.35 # width of the bars.
p0 = a1.bar(ind, dfcumulations2050['glass'], width, color='c')
p1 = a1.bar(ind, dfcumulations2050['aluminium_frames'], width,
bottom=dfcumulations2050['bottom1'])
p2 = a1.bar(ind, dfcumulations2050['silicon'], width,
bottom=dfcumulations2050['bottom2'])
p3 = a1.bar(ind, dfcumulations2050['copper'], width,
bottom=dfcumulations2050['bottom3'])
p4 = a1.bar(ind, dfcumulations2050['silver'], width,
bottom=dfcumulations2050['bottom4'])
a1.yaxis.set_label_position("right")
a1.yaxis.tick_right()
a1.set_ylabel('Cumulative End of Life Material by 2050 [Million Tonnes]')
a1.set_xlabel('Scenario')
a1.set_xticks(ind, ('S1', 'S2'))
#plt.yticks(np.arange(0, 81, 10))
a1.legend((p0[0], p1[0], p2[0], p3[0], p4[0] ), ('Glass', 'aluminium_frames', 'Silicon','Copper','Silver'))
f.tight_layout()
fig.savefig(os.path.join(testfolder,'Fig_2x1_Yearly EoL Waste by SCenario and Cumulatives_NREL2018.png'), dpi=600)
print("Cumulative Waste by EoL 2050 Million Tones by Scenario")
dfcumulations2050[['glass','silicon','silver','copper','aluminium_frames']].sum(axis=1)
C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py:89: MatplotlibDeprecationWarning: Passing the minor parameter of set_ticks() positionally is deprecated since Matplotlib 3.2; the parameter will become keyword-only two minor releases later.
Cumulative Waste by EoL 2050 Million Tones by Scenario
0 6.495971 1 8.922681 dtype: float64
# Loop over CASES
name0 = 'PV_ICE_base'
name2 = 'PV_ICE_high'
name3 = 'Irena_EL_high'
name4 = 'Irena_RL_high'
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2016])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2016])
matcum.append(UScum[keyw+materials[ii]+'_'+name3].loc[2016])
matcum.append(UScum[keyw+materials[ii]+'_'+name4].loc[2016])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['Module'] = dfcumulations2050.sum(axis=1)
dfcumulations2050['Module']
0 0.010549 1 0.010549 2 0.032417 3 0.002463 Name: Module, dtype: float64
# Loop over CASES
name0 = 'PV_ICE_base'
name2 = 'PV_ICE_high'
name3 = 'Irena_EL_high'
name4 = 'Irena_RL_high'
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2020])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2020])
matcum.append(UScum[keyw+materials[ii]+'_'+name3].loc[2020])
matcum.append(UScum[keyw+materials[ii]+'_'+name4].loc[2020])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['Module'] = dfcumulations2050.sum(axis=1)
dfcumulations2050['Module']
0 0.029290 1 0.029215 2 0.145703 3 0.009968 Name: Module, dtype: float64
# Loop over CASES
name0 = 'PV_ICE_base'
name2 = 'PV_ICE_high'
name3 = 'Irena_EL_high'
name4 = 'Irena_RL_high'
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2030])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2030])
matcum.append(UScum[keyw+materials[ii]+'_'+name3].loc[2030])
matcum.append(UScum[keyw+materials[ii]+'_'+name4].loc[2030])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['Module'] = dfcumulations2050.sum(axis=1)
dfcumulations2050['Module']
0 0.248972 1 0.237210 2 3.052786 3 0.330092 Name: Module, dtype: float64
# Loop over CASES
name0 = 'PV_ICE_base'
name2 = 'PV_ICE_high'
name3 = 'Irena_EL_high'
name4 = 'Irena_RL_high'
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2040])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2040])
matcum.append(UScum[keyw+materials[ii]+'_'+name3].loc[2040])
matcum.append(UScum[keyw+materials[ii]+'_'+name4].loc[2040])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['Module'] = dfcumulations2050.sum(axis=1)
dfcumulations2050['Module']
0 2.206157 1 2.175454 2 19.982522 3 5.126565 Name: Module, dtype: float64
# Loop over CASES
name0 = 'PV_ICE_base'
name2 = 'PV_ICE_high'
name3 = 'Irena_EL_high'
name4 = 'Irena_RL_high'
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name3].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name4].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['Module'] = dfcumulations2050.sum(axis=1)
dfcumulations2050['Module']
0 6.495971 1 8.922681 2 56.422538 3 27.644714 Name: Module, dtype: float64
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='Waste_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
########################
# SUBPLOT 1
########################
#######################
# Loop over CASES
name2 = 'PV_ICE_high'
name0 = 'PV_ICE_base'
# SCENARIO 1 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name0]+USyearly[keyw+materials[1]+'_'+name0]+
USyearly[keyw+materials[2]+'_'+name0]+USyearly[keyw+materials[3]+'_'+name0]+
USyearly[keyw+materials[4]+'_'+name0])
glassmat = (USyearly[keyw+materials[0]+'_'+name0])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'k.', linewidth=5, label='S1: '+name0+' module mass')
a0.plot(USyearly.index, glassmat, 'k', linewidth=5, label='S1: '+name0+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name2]+USyearly[keyw+materials[1]+'_'+name2]+
USyearly[keyw+materials[2]+'_'+name2]+USyearly[keyw+materials[3]+'_'+name2]+
USyearly[keyw+materials[4]+'_'+name2])
glassmat = (USyearly[keyw+materials[0]+'_'+name2])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'c.', linewidth=5, label='S2: '+name2+' module mass')
a0.plot(USyearly.index, glassmat, 'c', linewidth=5, label='S2: '+name2+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
a0.legend()
a0.set_title('Yearly Manufacturing Scrap and EoL Material by Scenario')
a0.set_ylabel('Mass [Million Tonnes]')
a0.set_xlim([2020, 2050])
a0.set_xlabel('Years')
########################
# SUBPLOT 2
########################
#######################
# Calculate
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['bottom1'] = dfcumulations2050['glass']
dfcumulations2050['bottom2'] = dfcumulations2050['bottom1']+dfcumulations2050['aluminium_frames']
dfcumulations2050['bottom3'] = dfcumulations2050['bottom2']+dfcumulations2050['silicon']
dfcumulations2050['bottom4'] = dfcumulations2050['bottom3']+dfcumulations2050['copper']
## Plot BARS Stuff
ind=np.arange(2)
width=0.35 # width of the bars.
p0 = a1.bar(ind, dfcumulations2050['glass'], width, color='c')
p1 = a1.bar(ind, dfcumulations2050['aluminium_frames'], width,
bottom=dfcumulations2050['bottom1'])
p2 = a1.bar(ind, dfcumulations2050['silicon'], width,
bottom=dfcumulations2050['bottom2'])
p3 = a1.bar(ind, dfcumulations2050['copper'], width,
bottom=dfcumulations2050['bottom3'])
p4 = a1.bar(ind, dfcumulations2050['silver'], width,
bottom=dfcumulations2050['bottom4'])
a1.yaxis.set_label_position("right")
a1.yaxis.tick_right()
a1.set_ylabel('Cumulative Manufacturing Scrap and EoL Material \n by 2050 [Million Tonnes]')
a1.set_xlabel('Scenario')
a1.set_xticks(ind, ('S1', 'S2'))
#plt.yticks(np.arange(0, 81, 10))
a1.legend((p0[0], p1[0], p2[0], p3[0], p4[0] ), ('Glass', 'aluminium_frames', 'Silicon','Copper','Silver'))
f.tight_layout()
fig.savefig(os.path.join(testfolder,'Fig_2x1_Yearly MFG and EOL Material by Scenario and Cumulatives_NREL2018.png'), dpi=600)
print("Cumulative Waste Scrap and EoL 2050 Million Tones by Scenario")
dfcumulations2050[['glass','silicon','silver','copper','aluminium_frames']].sum(axis=1)
C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py:89: MatplotlibDeprecationWarning: Passing the minor parameter of set_ticks() positionally is deprecated since Matplotlib 3.2; the parameter will become keyword-only two minor releases later.
Cumulative Waste Scrap and EoL 2050 Million Tones by Scenario
0 8.162090 1 12.150297 dtype: float64
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='Waste_MFG_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
########################
# SUBPLOT 1
########################
#######################
# Loop over CASES
name2 = 'PV_ICE_high'
name0 = 'PV_ICE_base'
# SCENARIO 1 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name0]+USyearly[keyw+materials[1]+'_'+name0]+
USyearly[keyw+materials[2]+'_'+name0]+USyearly[keyw+materials[3]+'_'+name0]+
USyearly[keyw+materials[4]+'_'+name0])
glassmat = (USyearly[keyw+materials[0]+'_'+name0])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'k.', linewidth=5, label='S1: '+name0+' module mass')
a0.plot(USyearly.index, glassmat, 'k', linewidth=5, label='S1: '+name0+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name2]+USyearly[keyw+materials[1]+'_'+name2]+
USyearly[keyw+materials[2]+'_'+name2]+USyearly[keyw+materials[3]+'_'+name2]+
USyearly[keyw+materials[4]+'_'+name2])
glassmat = (USyearly[keyw+materials[0]+'_'+name2])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'c.', linewidth=5, label='S2: '+name2+' module mass')
a0.plot(USyearly.index, glassmat, 'c', linewidth=5, label='S2: '+name2+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
a0.legend()
a0.set_title('Yearly Manufacturing Scrap by Scenario')
a0.set_ylabel('Mass [Million Tonnes]')
a0.set_xlim([2020, 2050])
a0.set_xlabel('Years')
########################
# SUBPLOT 2
########################
#######################
# Calculate
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['bottom1'] = dfcumulations2050['glass']
dfcumulations2050['bottom2'] = dfcumulations2050['bottom1']+dfcumulations2050['aluminium_frames']
dfcumulations2050['bottom3'] = dfcumulations2050['bottom2']+dfcumulations2050['silicon']
dfcumulations2050['bottom4'] = dfcumulations2050['bottom3']+dfcumulations2050['copper']
## Plot BARS Stuff
ind=np.arange(2)
width=0.35 # width of the bars.
p0 = a1.bar(ind, dfcumulations2050['glass'], width, color='c')
p1 = a1.bar(ind, dfcumulations2050['aluminium_frames'], width,
bottom=dfcumulations2050['bottom1'])
p2 = a1.bar(ind, dfcumulations2050['silicon'], width,
bottom=dfcumulations2050['bottom2'])
p3 = a1.bar(ind, dfcumulations2050['copper'], width,
bottom=dfcumulations2050['bottom3'])
p4 = a1.bar(ind, dfcumulations2050['silver'], width,
bottom=dfcumulations2050['bottom4'])
a1.yaxis.set_label_position("right")
a1.yaxis.tick_right()
a1.set_ylabel('Cumulative Manufacturing Scrap by 2050 [Million Tonnes]')
a1.set_xlabel('Scenario')
a1.set_xticks(ind, ('S1', 'S2'))
#plt.yticks(np.arange(0, 81, 10))
a1.legend((p0[0], p1[0], p2[0], p3[0], p4[0] ), ('Glass', 'aluminium_frames', 'Silicon','Copper','Silver'))
f.tight_layout()
fig.savefig(os.path.join(testfolder,'Fig_2x1_YYearly MFG Waste by Scenario and Cumulatives_NREL2018.png'), dpi=600)
print("Cumulative MFG Scrap 2050 Million Tones by Scenario")
dfcumulations2050[['glass','silicon','silver','copper','aluminium_frames']].sum(axis=1)
C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py:89: MatplotlibDeprecationWarning: Passing the minor parameter of set_ticks() positionally is deprecated since Matplotlib 3.2; the parameter will become keyword-only two minor releases later.
Cumulative MFG Scrap 2050 Million Tones by Scenario
0 1.666118 1 3.227617 dtype: float64
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='VirginStock_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
fig, axs = plt.subplots(3,2, figsize=(18, 10), facecolor='w', edgecolor='k')
fig.subplots_adjust(hspace = .5, wspace=.2)
axs = axs.ravel()
########################
# SUBPLOT 1
########################
#######################
# Loop over CASES
name2 = 'PV_ICE_high'
name0 = 'PV_ICE_base'
name3 = 'Irena_EL_high'
name4 = 'Irena_RL_high'
# SCENARIO 1 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name0]+USyearly[keyw+materials[1]+'_'+name0]+
USyearly[keyw+materials[2]+'_'+name0]+USyearly[keyw+materials[3]+'_'+name0]+
USyearly[keyw+materials[4]+'_'+name0])
glassmat = (USyearly[keyw+materials[0]+'_'+name0])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
axs[0].plot(USyearly.index, modulemat, 'k.', linewidth=5, label='S1: '+name0+' module mass')
axs[0].plot(USyearly.index, glassmat, 'k', linewidth=5, label='S1: '+name0+' glass mass only')
axs[0].fill_between(USyearly.index, glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name2]+USyearly[keyw+materials[1]+'_'+name2]+
USyearly[keyw+materials[2]+'_'+name2]+USyearly[keyw+materials[3]+'_'+name2]+
USyearly[keyw+materials[4]+'_'+name2])
glassmat = (USyearly[keyw+materials[0]+'_'+name2])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
axs[0].plot(USyearly.index, modulemat, 'c.', linewidth=5, label='S2: '+name2+' module mass')
axs[0].plot(USyearly.index, glassmat, 'c', linewidth=5, label='S2: '+name2+' glass mass only')
axs[0].fill_between(USyearly.index, glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
#axs[0].legend()
axs[0].set_title('Yearly Virgin Material Needs by Scenario')
axs[0].set_ylabel('Mass [Million Tonnes]')
axs[0].set_xlim([2020, 2050])
axs[0].set_xlabel('Years')
# SCENARIO 3 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name3]+USyearly[keyw+materials[1]+'_'+name3]+
USyearly[keyw+materials[2]+'_'+name3]+USyearly[keyw+materials[3]+'_'+name3]+
USyearly[keyw+materials[4]+'_'+name3])
glassmat = (USyearly[keyw+materials[0]+'_'+name3])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
axs[1].plot(USyearly.index, modulemat, 'g.', linewidth=5, label='S2: '+name3+' module mass')
axs[1].plot(USyearly.index, glassmat, 'g', linewidth=5, label='S2: '+name3+' glass mass only')
axs[1].fill_between(USyearly.index, glassmat, modulemat, color='g', alpha=0.3,
interpolate=True)
# SCENARIO 4 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name4]+USyearly[keyw+materials[1]+'_'+name4]+
USyearly[keyw+materials[2]+'_'+name4]+USyearly[keyw+materials[3]+'_'+name4]+
USyearly[keyw+materials[4]+'_'+name4])
glassmat = (USyearly[keyw+materials[0]+'_'+name4])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
axs[1].plot(USyearly.index, modulemat, 'b.', linewidth=5, label='S4: '+name4+' module mass')
axs[1].plot(USyearly.index, glassmat, 'b', linewidth=5, label='S4: '+name4+' glass mass only')
axs[1].fill_between(USyearly.index, glassmat, modulemat, color='b', alpha=0.3,
interpolate=True)
#axs[1].legend()
axs[1].set_title('Yearly Virgin Material Needs by Scenario')
axs[1].set_ylabel('Mass [Million Tonnes]')
axs[1].set_xlim([2020, 2050])
axs[1].set_xlabel('Years')
#### ROW 2
keyw='Waste_EOL_'
# SCENARIO 1 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name0]+USyearly[keyw+materials[1]+'_'+name0]+
USyearly[keyw+materials[2]+'_'+name0]+USyearly[keyw+materials[3]+'_'+name0]+
USyearly[keyw+materials[4]+'_'+name0])
glassmat = (USyearly[keyw+materials[0]+'_'+name0])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
axs[2].plot(USyearly.index, modulemat, 'k.', linewidth=5, label='S1: '+name0+' module mass')
axs[2].plot(USyearly.index, glassmat, 'k', linewidth=5, label='S1: '+name0+' glass mass only')
axs[2].fill_between(USyearly.index, glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name2]+USyearly[keyw+materials[1]+'_'+name2]+
USyearly[keyw+materials[2]+'_'+name2]+USyearly[keyw+materials[3]+'_'+name2]+
USyearly[keyw+materials[4]+'_'+name2])
glassmat = (USyearly[keyw+materials[0]+'_'+name2])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
axs[2].plot(USyearly.index, modulemat, 'c.', linewidth=5, label='S2: '+name2+' module mass')
axs[2].plot(USyearly.index, glassmat, 'c', linewidth=5, label='S2: '+name2+' glass mass only')
axs[2].fill_between(USyearly.index, glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
#axs[0].legend()
axs[2].set_title('Yearly EoL Material by Scenario')
axs[2].set_ylabel('Mass [Million Tonnes]')
axs[2].set_xlim([2020, 2050])
axs[2].set_xlabel('Years')
# SCENARIO 3 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name3]+USyearly[keyw+materials[1]+'_'+name3]+
USyearly[keyw+materials[2]+'_'+name3]+USyearly[keyw+materials[3]+'_'+name3]+
USyearly[keyw+materials[4]+'_'+name3])
glassmat = (USyearly[keyw+materials[0]+'_'+name3])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
axs[3].plot(USyearly.index, modulemat, 'g.', linewidth=5, label='S2: '+name3+' module mass')
axs[3].plot(USyearly.index, glassmat, 'g', linewidth=5, label='S2: '+name3+' glass mass only')
axs[3].fill_between(USyearly.index, glassmat, modulemat, color='g', alpha=0.3,
interpolate=True)
# SCENARIO 4 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name4]+USyearly[keyw+materials[1]+'_'+name4]+
USyearly[keyw+materials[2]+'_'+name4]+USyearly[keyw+materials[3]+'_'+name4]+
USyearly[keyw+materials[4]+'_'+name4])
glassmat = (USyearly[keyw+materials[0]+'_'+name4])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
axs[3].plot(USyearly.index, modulemat, 'b.', linewidth=5, label='S4: '+name4+' module mass')
axs[3].plot(USyearly.index, glassmat, 'b', linewidth=5, label='S4: '+name4+' glass mass only')
axs[3].fill_between(USyearly.index, glassmat, modulemat, color='b', alpha=0.3,
interpolate=True)
#axs[1].legend()
axs[3].set_title('Yearly EoL Material by Scenario')
axs[3].set_ylabel('Mass [Million Tonnes]')
axs[3].set_xlim([2020, 2050])
axs[3].set_xlabel('Years')
#### ROW 3
keyw='Waste_MFG_'
# SCENARIO 1 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name0]+USyearly[keyw+materials[1]+'_'+name0]+
USyearly[keyw+materials[2]+'_'+name0]+USyearly[keyw+materials[3]+'_'+name0]+
USyearly[keyw+materials[4]+'_'+name0])
glassmat = (USyearly[keyw+materials[0]+'_'+name0])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
axs[4].plot(USyearly.index, modulemat, 'k.', linewidth=5, label='S1: '+name0+' module mass')
axs[4].plot(USyearly.index, glassmat, 'k', linewidth=5, label='S1: '+name0+' glass mass only')
axs[4].fill_between(USyearly.index, glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name2]+USyearly[keyw+materials[1]+'_'+name2]+
USyearly[keyw+materials[2]+'_'+name2]+USyearly[keyw+materials[3]+'_'+name2]+
USyearly[keyw+materials[4]+'_'+name2])
glassmat = (USyearly[keyw+materials[0]+'_'+name2])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
axs[4].plot(USyearly.index, modulemat, 'c.', linewidth=5, label='S2: '+name2+' module mass')
axs[4].plot(USyearly.index, glassmat, 'c', linewidth=5, label='S2: '+name2+' glass mass only')
axs[4].fill_between(USyearly.index, glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
#axs[0].legend()
axs[4].set_title('Yearly Manufacturing Waste by Scenario')
axs[4].set_ylabel('Mass [Million Tonnes]')
axs[4].set_xlim([2020, 2050])
axs[4].set_xlabel('Years')
########################
# SUBPLOT 2
########################
#######################
# Calculate
fig.savefig(os.path.join(testfolder,'Fig_2x1_Yearly Virgin Material Needs by Scenario and Cumulatives_NREL2018.png'), dpi=600)
print("Cumulative Virgin Needs by 2050 Million Tones by Scenario")
Cumulative Virgin Needs by 2050 Million Tones by Scenario
# 3 sig figs
USyearly3sig = USyearly.copy()
UScum3sig = UScum.copy()
N = 2
UScum3sig = UScum3sig.drop(UScum3sig.index[0])
USyearly3sig = USyearly3sig.drop(USyearly3sig.index[0])
UScum3sig = UScum3sig.loc[:, ~UScum3sig.columns.str.startswith('Waste_MFG_')]
USyearly3sig = USyearly3sig.loc[:, ~USyearly3sig.columns.str.startswith('Waste_MFG_')]
USyearly3sig = USyearly3sig.applymap(lambda x: round(x, N - int(np.floor(np.log10(abs(x))))))
USyearly3sig = USyearly3sig.applymap(lambda x: int(x))
UScum3sig = UScum3sig.applymap(lambda x: round(x, N - int(np.floor(np.log10(abs(x))))))
UScum3sig = UScum3sig.applymap(lambda x: int(x))
materials = ['Module','glass', 'aluminium_frames', 'copper', 'silicon', 'silver']
scencases = ['_base', '_high']
print(" Appendix Table I: Metric Tonnes Installed in field in 2030")
print(" ########################################################### \n")
#Loop over scenarios
for zz in range(0, len(scencases)):
scencase = scencases[zz]
for kk in range (0, len(objects)):
obj = objects[kk].name
print("SCENARIO :", obj), print("~~~~>>>> Case ", scencase)
print("********************************")
print("********************************")
modulemat = 0
for ii in range(0, len(materials)):
installedmat = (UScum3sig['VirginStock_'+materials[ii]+'_'+obj+scencase].loc[2030]-
UScum3sig['Waste_'+materials[ii]+'_'+obj+'_base'].loc[2030])
print(materials[ii], ':', round(installedmat/1000)*1000, 'tons')
print("Capacity in Year 2030 [GW]:", round(UScum3sig['Capacity_'+obj+scencase].loc[2030]/1e9))
print("Capacity in Year 2050 [GW]:", round(UScum3sig['Capacity_'+obj+scencase].loc[2050]/1e9))
print("****************************\n")
Appendix Table I: Metric Tonnes Installed in field in 2030 ########################################################### SCENARIO : PV_ICE ~~~~>>>> Case _base ******************************** ******************************** Module : 17330000 tons glass : 15580000 tons aluminium_frames : 2107000 tons copper : 14000 tons silicon : 658000 tons silver : 6000 tons Capacity in Year 2030 [GW]: 348 Capacity in Year 2050 [GW]: 924 **************************** SCENARIO : bifacialTrend ~~~~>>>> Case _base ******************************** ******************************** Module : 18000000 tons glass : 16362000 tons aluminium_frames : 1880000 tons copper : 14000 tons silicon : 658000 tons silver : 6000 tons Capacity in Year 2030 [GW]: 348 Capacity in Year 2050 [GW]: 924 **************************** SCENARIO : Irena_EL ~~~~>>>> Case _base ******************************** ******************************** Module : 13170000 tons glass : 13450000 tons aluminium_frames : 1776000 tons copper : 11000 tons silicon : 500000 tons silver : 4000 tons Capacity in Year 2030 [GW]: 309 Capacity in Year 2050 [GW]: 541 **************************** SCENARIO : Irena_RL ~~~~>>>> Case _base ******************************** ******************************** Module : 17560000 tons glass : 15249000 tons aluminium_frames : 2096000 tons copper : 13000 tons silicon : 586000 tons silver : 5000 tons Capacity in Year 2030 [GW]: 347 Capacity in Year 2050 [GW]: 765 **************************** SCENARIO : PV_ICE ~~~~>>>> Case _high ******************************** ******************************** Module : 33130000 tons glass : 28980000 tons aluminium_frames : 3767000 tons copper : 25000 tons silicon : 1330000 tons silver : 10000 tons Capacity in Year 2030 [GW]: 651 Capacity in Year 2050 [GW]: 1950 **************************** SCENARIO : bifacialTrend ~~~~>>>> Case _high ******************************** ******************************** Module : 34400000 tons glass : 30762000 tons aluminium_frames : 3290000 tons copper : 25000 tons silicon : 1330000 tons silver : 10000 tons Capacity in Year 2030 [GW]: 651 Capacity in Year 2050 [GW]: 1950 **************************** SCENARIO : Irena_EL ~~~~>>>> Case _high ******************************** ******************************** Module : 28270000 tons glass : 26350000 tons aluminium_frames : 3426000 tons copper : 22000 tons silicon : 960000 tons silver : 7000 tons Capacity in Year 2030 [GW]: 602 Capacity in Year 2050 [GW]: 1040 **************************** SCENARIO : Irena_RL ~~~~>>>> Case _high ******************************** ******************************** Module : 32660000 tons glass : 28149000 tons aluminium_frames : 3746000 tons copper : 23000 tons silicon : 1046000 tons silver : 8000 tons Capacity in Year 2030 [GW]: 650 Capacity in Year 2050 [GW]: 1600 ****************************
print(" WASTE EoL CUMULATIVE RESULTS [Tonnes] ")
print(" ******************************************")
filter_col = [col for col in UScum3sig if (col.startswith('Waste_EOL_Module')) ]
display(UScum3sig[filter_col].loc[[2016,2020,2030, 2040, 2050]])
WASTE EoL CUMULATIVE RESULTS [Tonnes] ******************************************
| Waste_EOL_Module_PV_ICE_base | Waste_EOL_Module_PV_ICE_high | Waste_EOL_Module_bifacialTrend_base | Waste_EOL_Module_bifacialTrend_high | Waste_EOL_Module_Irena_EL_base | Waste_EOL_Module_Irena_EL_high | Waste_EOL_Module_Irena_RL_base | Waste_EOL_Module_Irena_RL_high | |
|---|---|---|---|---|---|---|---|---|
| year | ||||||||
| 2016 | 493000 | 493000 | 493000 | 493000 | 130000 | 130000 | 9850 | 9850 |
| 2020 | 932000 | 1060000 | 932000 | 1060000 | 583000 | 583000 | 39900 | 39900 |
| 2030 | 3200000 | 4660000 | 3240000 | 4750000 | 10100000 | 12200000 | 1280000 | 1320000 |
| 2040 | 12300000 | 15500000 | 12400000 | 15700000 | 46400000 | 79900000 | 15800000 | 20500000 |
| 2050 | 31000000 | 45400000 | 31300000 | 46000000 | 106000000 | 226000000 | 60200000 | 111000000 |
UScum['Waste_EOL_Module_PV_ICE_base'].iloc[-1]
30982239.69008196
print(" WASTE EoL CUMULATIVE RESULTS [Tonnes] ")
print(" ******************************************")
filter_col = [col for col in UScum if (col.startswith('Waste_EOL_Module')) ]
display(UScum[filter_col].loc[[2016,2020,2030, 2040, 2050]])
WASTE EoL CUMULATIVE RESULTS [Tonnes] ******************************************
| Waste_EOL_Module_PV_ICE_base | Waste_EOL_Module_PV_ICE_high | Waste_EOL_Module_bifacialTrend_base | Waste_EOL_Module_bifacialTrend_high | Waste_EOL_Module_Irena_EL_base | Waste_EOL_Module_Irena_EL_high | Waste_EOL_Module_Irena_RL_base | Waste_EOL_Module_Irena_RL_high | |
|---|---|---|---|---|---|---|---|---|
| year | ||||||||
| 2016 | 4.931018e+05 | 4.931018e+05 | 4.931018e+05 | 4.931018e+05 | 1.296684e+05 | 1.296684e+05 | 9.852739e+03 | 9.852739e+03 |
| 2020 | 9.318070e+05 | 1.057508e+06 | 9.317318e+05 | 1.057340e+06 | 5.828125e+05 | 5.828125e+05 | 3.987065e+04 | 3.987065e+04 |
| 2030 | 3.198164e+06 | 4.657176e+06 | 3.244705e+06 | 4.754722e+06 | 1.006816e+07 | 1.221115e+07 | 1.280312e+06 | 1.320368e+06 |
| 2040 | 1.234279e+07 | 1.552997e+07 | 1.242666e+07 | 1.571440e+07 | 4.637030e+07 | 7.993009e+07 | 1.580665e+07 | 2.050626e+07 |
| 2050 | 3.098224e+07 | 4.537357e+07 | 3.130357e+07 | 4.603015e+07 | 1.063554e+08 | 2.256902e+08 | 6.017308e+07 | 1.105789e+08 |
name2 = 'bifacialTrend_high'
name0 = 'bifacialTrend_base'
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
print("Cumulative Virgin Needs by 2050 Million Tones by Scenario for Bifacial Trend")
dfcumulations2050[['glass','silicon','silver','copper','aluminium_frames']].sum(axis=1)
Cumulative Virgin Needs by 2050 Million Tones by Scenario for Bifacial Trend
0 1.705842 1 3.311863 dtype: float64
name2 = 'Irena_EL_high'
name0 = 'Irena_EL_base'
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
print("Cumulative Virgin Needs by 2050 Million Tones by Scenario for Irena_EL")
dfcumulations2050[['glass','silicon','silver','copper','aluminium_frames']].sum(axis=1)
Cumulative Virgin Needs by 2050 Million Tones by Scenario for Irena_EL
0 -3.568208e-16 1 4.365171e-16 dtype: float64
name2 = 'Irena_RL_high'
name0 = 'Irena_RL_base'
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
print("Cumulative Virgin Needs by 2050 Million Tones by Scenario for Irena_RL")
dfcumulations2050[['glass','silicon','silver','copper','aluminium_frames']].sum(axis=1)
Cumulative Virgin Needs by 2050 Million Tones by Scenario for Irena_RL
0 -3.568208e-16 1 4.365171e-16 dtype: float64
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='Waste_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
########################
# SUBPLOT 1
########################
#######################
# loop plotting over scenarios
name2 = 'PV_ICE_high'
name0 = 'PV_ICE_base'
# SCENARIO 1 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name0]+USyearly[keyw+materials[1]+'_'+name0]+
USyearly[keyw+materials[2]+'_'+name0]+USyearly[keyw+materials[3]+'_'+name0]+
USyearly[keyw+materials[4]+'_'+name0])
glassmat = (USyearly[keyw+materials[0]+'_'+name0])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'k.', linewidth=5, label='S1: '+name0+' module mass')
a0.plot(USyearly.index, glassmat, 'k', linewidth=5, label='S1: '+name0+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name2]+USyearly[keyw+materials[1]+'_'+name2]+
USyearly[keyw+materials[2]+'_'+name2]+USyearly[keyw+materials[3]+'_'+name2]+
USyearly[keyw+materials[4]+'_'+name2])
glassmat = (USyearly[keyw+materials[0]+'_'+name2])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'c.', linewidth=5, label='S2: '+name2+' module mass')
a0.plot(USyearly.index, glassmat, 'c', linewidth=5, label='S2: '+name2+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
a0.legend()
a0.set_title('Yearly Material Waste by Scenario')
a0.set_ylabel('Mass [Million Tonnes]')
a0.set_xlim([2020, 2050])
a0.set_xlabel('Years')
########################
# SUBPLOT 2
########################
#######################
# Calculate
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['bottom1'] = dfcumulations2050['glass']
dfcumulations2050['bottom2'] = dfcumulations2050['bottom1']+dfcumulations2050['aluminium_frames']
dfcumulations2050['bottom3'] = dfcumulations2050['bottom2']+dfcumulations2050['silicon']
dfcumulations2050['bottom4'] = dfcumulations2050['bottom3']+dfcumulations2050['copper']
## Plot BARS Stuff
ind=np.arange(2)
width=0.35 # width of the bars.
p0 = a1.bar(ind, dfcumulations2050['glass'], width, color='c')
p1 = a1.bar(ind, dfcumulations2050['aluminium_frames'], width,
bottom=dfcumulations2050['bottom1'])
p2 = a1.bar(ind, dfcumulations2050['silicon'], width,
bottom=dfcumulations2050['bottom2'])
p3 = a1.bar(ind, dfcumulations2050['copper'], width,
bottom=dfcumulations2050['bottom3'])
p4 = a1.bar(ind, dfcumulations2050['silver'], width,
bottom=dfcumulations2050['bottom4'])
a1.yaxis.set_label_position("right")
a1.yaxis.tick_right()
a1.set_ylabel('Cumulative Waste by 2050 [Million Tonnes]')
a1.set_xlabel('Scenario')
a1.set_xticks(ind, ('S1', 'S2'))
#plt.yticks(np.arange(0, 81, 10))
a1.legend((p0[0], p1[0], p2[0], p3[0], p4[0] ), ('Glass', 'aluminium_frames', 'Silicon','Copper','Silver'))
f.tight_layout()
f.savefig(' Fig_2x1_Yearly WASTE by Scenario and Cumulatives_NREL2018.png', dpi=600)
print("Cumulative Waste by 2050 Million Tones by case")
dfcumulations2050[['glass','silicon','silver','copper','aluminium_frames']].sum(axis=1)
C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py:89: MatplotlibDeprecationWarning: Passing the minor parameter of set_ticks() positionally is deprecated since Matplotlib 3.2; the parameter will become keyword-only two minor releases later.
Cumulative Waste by 2050 Million Tones by case
0 8.162090 1 12.150297 dtype: float64
plt.rcParams.update({'font.size': 15})
plt.rcParams['figure.figsize'] = (15, 8)
keyw='Waste_EOL_'
materials = ['glass', 'silicon', 'silver', 'copper', 'aluminium_frames']
f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]})
########################
# SUBPLOT 1
########################
#######################
# loop plotting over scenarios
name2 = 'PV_ICE_high'
name0 = 'PV_ICE_base'
# SCENARIO 1 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name0]+USyearly[keyw+materials[1]+'_'+name0]+
USyearly[keyw+materials[2]+'_'+name0]+USyearly[keyw+materials[3]+'_'+name0]+
USyearly[keyw+materials[4]+'_'+name0])
glassmat = (USyearly[keyw+materials[0]+'_'+name0])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'k.', linewidth=5, label='S1: '+name0+' module mass')
a0.plot(USyearly.index, glassmat, 'k', linewidth=5, label='S1: '+name0+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='k', alpha=0.3,
interpolate=True)
# SCENARIO 2 ***************
modulemat = (USyearly[keyw+materials[0]+'_'+name2]+USyearly[keyw+materials[1]+'_'+name2]+
USyearly[keyw+materials[2]+'_'+name2]+USyearly[keyw+materials[3]+'_'+name2]+
USyearly[keyw+materials[4]+'_'+name2])
glassmat = (USyearly[keyw+materials[0]+'_'+name2])
modulemat = modulemat/1000000
glassmat = glassmat/1000000
a0.plot(USyearly.index, modulemat, 'c.', linewidth=5, label='S2: '+name2+' module mass')
a0.plot(USyearly.index, glassmat, 'c', linewidth=5, label='S2: '+name2+' glass mass only')
a0.fill_between(USyearly.index, glassmat, modulemat, color='c', alpha=0.3,
interpolate=True)
a0.legend()
a0.set_title('Yearly Material Waste by Scenario')
a0.set_ylabel('Mass [Million Tonnes]')
a0.set_xlim([2020, 2050])
a0.set_xlabel('Years')
########################
# SUBPLOT 2
########################
#######################
# Calculate
cumulations2050 = {}
for ii in range(0, len(materials)):
matcum = []
matcum.append(UScum[keyw+materials[ii]+'_'+name0].loc[2050])
matcum.append(UScum[keyw+materials[ii]+'_'+name2].loc[2050])
cumulations2050[materials[ii]] = matcum
dfcumulations2050 = pd.DataFrame.from_dict(cumulations2050)
dfcumulations2050 = dfcumulations2050/1000000 # in Million Tonnes
dfcumulations2050['bottom1'] = dfcumulations2050['glass']
dfcumulations2050['bottom2'] = dfcumulations2050['bottom1']+dfcumulations2050['aluminium_frames']
dfcumulations2050['bottom3'] = dfcumulations2050['bottom2']+dfcumulations2050['silicon']
dfcumulations2050['bottom4'] = dfcumulations2050['bottom3']+dfcumulations2050['copper']
## Plot BARS Stuff
ind=np.arange(2)
width=0.35 # width of the bars.
p0 = a1.bar(ind, dfcumulations2050['glass'], width, color='c')
p1 = a1.bar(ind, dfcumulations2050['aluminium_frames'], width,
bottom=dfcumulations2050['bottom1'])
p2 = a1.bar(ind, dfcumulations2050['silicon'], width,
bottom=dfcumulations2050['bottom2'])
p3 = a1.bar(ind, dfcumulations2050['copper'], width,
bottom=dfcumulations2050['bottom3'])
p4 = a1.bar(ind, dfcumulations2050['silver'], width,
bottom=dfcumulations2050['bottom4'])
a1.yaxis.set_label_position("right")
a1.yaxis.tick_right()
a1.set_ylabel('Cumulative EOL Only Waste by 2050 [Million Tonnes]')
a1.set_xlabel('Scenario')
a1.set_xticks(ind, ('S1', 'S2'))
#plt.yticks(np.arange(0, 81, 10))
a1.legend((p0[0], p1[0], p2[0], p3[0], p4[0] ), ('Glass', 'aluminium_frames', 'Silicon','Copper','Silver'))
f.tight_layout()
f.savefig('Fig_2x1_Yearly EOL Only WASTE by Scenario and Cumulatives_NREL2018.png', dpi=600)
print("Cumulative Eol Only Waste by 2050 Million Tones by case")
dfcumulations2050[['glass','silicon','silver','copper','aluminium_frames']].sum(axis=1)
C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py:89: MatplotlibDeprecationWarning: Passing the minor parameter of set_ticks() positionally is deprecated since Matplotlib 3.2; the parameter will become keyword-only two minor releases later.
Cumulative Eol Only Waste by 2050 Million Tones by case
0 6.495971 1 8.922681 dtype: float64